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.util.*;
import java.math.*;
import java.io.*;

public class CF665E {
	void add(int x) {
		int node = 0;
		for(int i = MAXBIT ; i >= 0 ; i--) {
			int bit = Math.min(1, x & (1 << i));
			if(trie[bit][node] == 0)
				trie[bit][node] = next++;
			node = trie[bit][node];
			cnt[node]++;
		}
		end[node]++;
	}
	long solve(int xor) {
		int node = 0;
		long res = 0;
		for(int i = MAXBIT ; i >= 0 ; i--) {
			int bit = Math.min(1, xor & (1 << i));
			int rev = bit ^ 1; // opposite of our current bit
			// if k has this bit, we must take it and then
			// continue to the next bit
			if((k & (1 << i)) > 0) {
				// if we cannot maintain this bit, we have to break
				if(trie[rev][node] == 0) break;
				node = trie[rev][node];
				continue;
			}
			// if we can force the next bit to be on, since we have maintained
			// equality with up to this point, all values down this path
			// can be used as a valid range.
			if(bit == 0) {
				if(trie[1][node] != 0) res += cnt[trie[1][node]];
				if(trie[0][node] == 0) break;
				node = trie[0][node];
			} else {
				if(trie[0][node] != 0) res += cnt[trie[0][node]];
				if(trie[1][node] == 0) break;
				node = trie[1][node];
			}
		}
		res += end[node];
		return res;
	}
	final int MAXBIT = 30;
	final int MAX = 1 + 15 * (int) 1e6;
	final int ALPHA = 2;
	int k, next = 1, end[], cnt[], trie[][];
	public CF665E() {
		end = new int[MAX];
		cnt = new int[MAX];
		trie = new int[ALPHA][MAX];
		FS scan = new FS();
		int n = scan.nextInt();  k = scan.nextInt();
		int[] a = new int[n];
		int[] xor = new int[n + 1];
		for(int i = 0 ; i < n ; i++)
			a[i] = scan.nextInt();
		for(int i = 1 ; i <= n ; i++)
			xor[i] = xor[i - 1] ^ a[i - 1];
		long res = 0;
		for(int i = n ; i >= 0 ; i--) {
			res += solve(xor[i]);
			add(xor[i]);
		}
		System.out.println(res);
	}
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next() {
			while(!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) { e.printStackTrace(); }
			}
			return st.nextToken();
		}
		public int nextInt() { return Integer.parseInt(next()); }
	}
	public static void main(String[] args) { new CF665E(); }
}
