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
// Don't place your source in a package


import javax.swing.*;
import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
import java.util.stream.Stream;



// Please name your class Main
public class Main {
    static FastScanner fs=new FastScanner();
    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }
        int Int() {
            return Integer.parseInt(next());
        }

        long Long() {
            return Long.parseLong(next());
        }

        String Str(){
            return next();
        }
    }


    public static void main (String[] args) throws java.lang.Exception {
        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        //reading /writing file
        //Scanner sc=new Scanner(new File("input.txt"));
        //PrintWriter pr=new PrintWriter("output.txt");



        int T=1;

        for(int t=0;t<T;t++){
            int n =Int();int k=Int();
            int A[]=new int[n];
            for(int i=0;i<n;i++){
                A[i]=Int();
            }

            Solution sol1=new Solution(out);
            sol1.solution(A,k);
        }
        out.close();

    }


    public static int[] Arr(int n){
        int A[]=new int[n];
        for(int i=0;i<n;i++)A[i]=Int();
        return A;
    }
    public static int Int(){
        return fs.Int();
    }
    public static long Long(){
        return fs.Long();
    }
    public static String Str(){
        return fs.Str();
    }

}








class Solution {
    PrintWriter out;
    int INF = Integer.MAX_VALUE;
    int MOD = 1000000007;
    long mod = 1000000007;

    public Solution(PrintWriter out) {
        this.out = out;

    }


    int trie[][];
    int next=1;
    int cnts[];
    public void solution(int A[],int k) {
        trie=new int[2][1 + 15 * (int) 1e6];
        cnts=new int[1 + 15 * (int) 1e6];
        int xor=0;
        long res=0;
        for(int i=0;i<A.length;i++){
            xor=xor^A[i];
            if(xor>=k)res++;
            res+=find(trie,k,xor);
            insert(trie,xor);
        }
        out.println(res);
    }

    public int find(int trie[][],int k,int xor){
        int cur =0;
        int res=0;
        for(int i=30;i>=0;i--){
            if((k&(1<<i))!=0){//k = 1
                if((xor&(1<<i))!=0){
                    cur=trie[0][cur];
                }
                else{
                   cur=trie[1][cur];
                }
            }
            else{//k = 0
                if((xor&(1<<i))!=0){
                    if(trie[0][cur]!=0)res+=cnts[trie[0][cur]];
                    cur=trie[1][cur];
                }
                else{
                    res+=cnts[trie[1][cur]];
                    cur=trie[0][cur];
                }
            }
            if(cur==0)break;
        }
        res+=cnts[cur];
        return res;
    }

    class Trie{
        Trie left;
        Trie right;
        int cnt = 0;
    }


    public void insert(int trie[][],int n){
        int cur = 0;
        for(int i=30;i>=0;i--){
            if((n&(1<<i))!=0){
                if(trie[1][cur]==0){
                    trie[1][cur]=next++;
                }
                cnts[trie[1][cur]]++;
                cur=trie[1][cur];

            }
            else{
                if(trie[0][cur]==0){
                    trie[0][cur]=next++;
                }
                cnts[trie[0][cur]]++;
                cur=trie[0][cur];
            }
        }
    }

}

