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.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;


public class E {

	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	static int[][]next;
	static int[]cnt;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n = nextInt();
		int k = nextInt();
		long ans = 0;
		next = new int[2][30000001];
		cnt = new int[30000001];
		int cur = 0;
		int size = 0;
		for (int i = 0; i < 30; i++) {
			if (next[0][cur]==0) {
				next[0][cur] = ++size;
				cur = size;
			}
			else
				cur = next[0][cur];
			cnt[cur]++;
		}
		int a = 0;
		for (int i = 1; i <= n; i++) {
			a ^= nextInt();
			cur = 0;
			boolean ok = true;
			for (int j = 29; j >= 0; j--) {
				int a_bit = 0, k_bit = 0;
				if ((a & (1 << j)) != 0)
					a_bit  = 1;
				if ((k & (1 << j)) != 0)
					k_bit  = 1;
				if (k_bit==0) {
					if (next[1 ^ a_bit][cur] != 0) {
						ans += cnt[next[1 ^ a_bit][cur]];
					}
				}
				if (next[a_bit ^ k_bit][cur] != 0)
					cur = next[a_bit ^ k_bit][cur];
				else {
					ok = false;
					break;
				}
			}
			if (ok)
				ans += cnt[cur];
			cur = 0;
			for (int j = 29; j >= 0; j--) {
				int a_bit = 0;
				if ((a & (1 << j)) != 0)
					a_bit = 1;
				if (next[a_bit][cur]==0) {
					next[a_bit][cur] = ++size;
					cur = size;
				}
				else
					cur = next[a_bit][cur];
				cnt[cur]++;
			}
		}
		System.out.println(ans);
		pw.close();
	}
	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}
	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}
	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}
	private static String next() throws IOException {
		while (st==null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}
