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.*;
import java.util.Arrays;
import java.util.StringTokenizer;


public class Main {
    static final int max = (int) (30e6 + 10);

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        Trie.k = sc.nextInt();
        Trie trie = new Trie();
        trie.insert(0);
        long ans = 0;
        int cum = 0;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            cum = cum ^ x;
            ans += trie.count(cum);
            trie.insert(cum);
        }
        out.println(ans);
        out.flush();
        out.close();
    }

    static class Trie {
        static int k, size;
        static int[][] nodes;

        public Trie() {
            nodes = new int[3][max];
            Arrays.fill(nodes[0], -1);
            Arrays.fill(nodes[1], -1);
            size = 1;
        }

        void insert(int x) {
            int cur = 0;
            for (int i = 29; i >= 0; i--) {
                int bit = (x & 1 << i) == 0 ? 0 : 1;
                if (nodes[bit][cur] == -1) nodes[bit][cur] = size++;
                cur = nodes[bit][cur];
                nodes[2][cur]++;
            }
        }

        int count(int cum) {
            int ans = 0;
            int cur = 0;
            for (int i = 29; i >= 0 && cur != -1; i--) {
                int j = (cum & 1 << i) == 0 ? 1 : 0;
                if ((k & 1 << i) == 0) {
                    ans += nodes[j][cur] == -1 ? 0 : nodes[2][nodes[j][cur]];
                    j = 1 - j;
                }
                cur = nodes[j][cur];
            }
            if (cur != -1) ans += nodes[2][cur];
            return ans;
        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {
            br = new BufferedReader(new InputStreamReader(system));
        }


        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public char nextChar() throws IOException {
            return next().charAt(0);
        }

        public Long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public boolean ready() throws IOException {
            return br.ready();
        }


        public int[] nextIntArray(int n) throws IOException {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) throws IOException {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }


        public Integer[] nextIntegerArray(int n) throws IOException {
            Integer[] a = new Integer[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public double[] nextDoubleArray(int n) throws IOException {
            double[] ans = new double[n];
            for (int i = 0; i < n; i++)
                ans[i] = nextDouble();
            return ans;
        }

        public short nextShort() throws IOException {
            return Short.parseShort(next());
        }

    }

}