One day, ZS the Coder wrote down an array of integers a with elements a1, a2, ..., an.

A subarray of the array a is a sequence al, al + 1, ..., ar for some integers (l, r) such that 1 ≤ l ≤ r ≤ n. ZS the Coder thinks that a subarray of a is beautiful if the bitwise xor of all the elements in the subarray is at least k.

Help ZS the Coder find the number of beautiful subarrays of a!

Input

The first line contains two integers n and k (1 ≤ n ≤ 106, 1 ≤ k ≤ 109) — the number of elements in the array a and the value of the parameter k.

The second line contains n integers ai (0 ≤ ai ≤ 109) — the elements of the array a.

Output

Print the only integer c — the number of beautiful subarrays of the array a.

Examples

Input

3 1
1 2 3


Output

5


Input

3 2
1 2 3


Output

3


Input

3 3
1 2 3


Output

2
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class SubArrayXor {

    private int n;
    private int k;
    private InputReader sc;
    private long output;

    private static class Trie {

        private static int bitlength = 30;
        private int[][] trie;
        private int[] elemCount;
        private int nodeCount;

        Trie() {
            trie = new int[2][32 * (int) 1e6];
            trie[0][0] = trie[1][0] = -1;
            elemCount = new int[32 * (int) 1e6];
        }

        private int getCount(int x) {
            return x == -1 ? 0 : elemCount[x];
        }

        private int getBit(int x, int i) {
            return (x & (1 << i)) == 0 ? 0 : 1;
        }

        private void insert(int x) {
            int idx = 0;
            elemCount[idx]++;
            for (int i = bitlength; i >= 0; i--) {
                if (getBit(x, i) == 0) {
                    if (trie[0][idx] == -1) {
                        trie[0][idx] = ++nodeCount;
                        trie[0][nodeCount] = trie[1][nodeCount] = -1;
                    }
                    idx = trie[0][idx];
                } else {
                    if (trie[1][idx] == -1) {
                        trie[1][idx] = ++nodeCount;
                        trie[0][nodeCount] = trie[1][nodeCount] = -1;
                    }
                    idx = trie[1][idx];
                }
                elemCount[idx]++;
            }
        }

        private int getCurrentCount(int x, int k) {
            int idx = 0;
            int count = 0;
            for (int i = bitlength; i >= 0 && idx != -1; i--) {
                int gx = getBit(x, i);
                int gk = getBit(k, i);
                if (gk == 0) {
                    if (gx == 0) {
                        count += getCount(trie[1][idx]);
                        idx = trie[0][idx];
                    } else {
                        count += getCount(trie[0][idx]);
                        idx = trie[1][idx];
                    }
                } else {
                    if (gx == 0) {
                        idx = trie[1][idx];
                    } else {
                        idx = trie[0][idx];
                    }
                }
            }
            count += getCount(idx);
            return count;
        }
    }

    private void compute() {
        Trie trie = new Trie();
        trie.insert(0);
        int xor = 0;
        output = 0;

        for (int i = 0; i < n; i++) {
            xor ^= sc.nextInt();
            output += trie.getCurrentCount(xor, k);
            trie.insert(xor);
        }
    }

    private void input() {
        sc = new InputReader(System.in);
        n = sc.nextInt();
        k = sc.nextInt();
    }

    private void output() {
        System.out.println(output);
    }

    public static void main(String[] args) {
        SubArrayXor b = new SubArrayXor();
        b.input();
        b.compute();
        b.output();
    }

    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    }
}
