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.*;
public class E665 {
public static void main(String[] args) throws IOException {
	input.init(System.in);
	PrintWriter out = new PrintWriter(System.out);
	int n = input.nextInt(), k = input.nextInt();
	int[] as = new int[n];
	for(int i = 0; i<n; i++) as[i] = input.nextInt();
	int xor = 0;
	long res = 0;
	left = new int[20*n+100];
	right = new int[20*n+100];
	sum = new int[20*n+100];
	pow = new byte[20*n+100];
	pow[0] = 29;
	idx = 1;
	Arrays.fill(left, -1);
	Arrays.fill(right, -1);
	for(int i = 0; i<n; i++)
	{
		res += count(0, k, xor);
		//System.out.println(res);
		add(0, xor);
		//out.println(root);
		xor ^= as[i];
	}
	res += count(0, k, xor);
	out.println(res);
	out.close();
}
static int idx;
static int[] left, right, sum;
static byte[] pow;
static void add(int at, int x)
{
	sum[at]++;
	if(pow[at] == -1) return;
	if((x & (1<<pow[at])) > 0)
	{
		if(left[at] == -1)
		{
			left[at] = idx;
			pow[idx] = (byte) (pow[at] - 1);
			idx++;
		}
		add(left[at], x);
	}
	else
	{
		if(right[at] == -1)
		{
			right[at] = idx;
			pow[idx] = (byte)(pow[at] - 1);
			idx++;
		}
		add(right[at], x);
	}
}
static int count(int at, int s, int xor)
{
	if(sum[at] == 0) return 0;
	if(pow[at] == -1) return sum[at];
	//System.out.println(s+" "+xor+" "+pow+" "+sum);
	if((s & (1<<pow[at])) > 0)
	{
		// need 1
		if((xor & (1<<pow[at])) > 0) return right[at] == -1 ? 0 : count(right[at], s, xor);
		else return left[at] == -1 ? 0 : count(left[at], s, xor);
	}
	else
	{
		// 1 is automatic
		int res = 0;
		if((xor & (1<<pow[at])) > 0)
		{
			res += right[at] == -1 ? 0 : sum[right[at]];
			res += left[at] == -1 ? 0 : count(left[at], s, xor);
		}
		else
		{
			res += left[at] == -1 ? 0 : sum[left[at]];
			res += right[at] == -1 ? 0 : count(right[at], s, xor);
		}
		return res;
	}
}
public static class input {
	static BufferedReader reader;
	static StringTokenizer tokenizer;

	static void init(InputStream input) {
		reader = new BufferedReader(new InputStreamReader(input));
		tokenizer = new StringTokenizer("");
	}

	static String next() throws IOException {
		while (!tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(reader.readLine());
		return tokenizer.nextToken();
	}

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

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

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

