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 beautifulsubarray {
	public static void main(String[] args) throws Exception
	{
		InputReader in=new InputReader(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		int n=in.nextInt();
		int k=in.nextInt();
		int[] arr=new int[n+1];
		for(int i=1;i<=n;i++)
		{
			arr[i]=in.nextInt();
		}
		for(int i=1;i<=n;i++)
		{
			arr[i]=arr[i]^arr[i-1];
		}
		
		trie t=new trie();
		long ans=0;
		//System.out.println("hello");
		for(int i=1;i<=n;i++)
		{
			t.insert(arr[i-1]);
			//System.out.println("for "+i);
			ans+=t.query(arr[i], k);
			
		//	System.out.println(t.query(arr[i], k)+" for "+i);
			
		}
		pw.println(ans);
		
		
		
		
		
		
		
		
		
		
		pw.close();
	}
	static class trie
	{
		int[][] arr;
		int[] cnt;
		int root=0;
		static int cc=1;
			public trie()
			{
			
				arr=new int[2][(int)(32*1e6)];
				cnt=new int[(int)(32*1e6)];
				Arrays.fill(arr[0], -1);
				Arrays.fill(arr[1], -1);
				
			}
			public void insert(long num)
			{
				int	current=root;
				cnt[root]++;
				for(int i=30;i>=0;i--)
				{
					long bit=((1 << i) & num);
					if(bit>0)
					{
						if(arr[1][current]==-1)
						{
							//current.one=new trinode();
							arr[1][current]=cc;
							cc++;
						}
						
						current=arr[1][current];
					}
					else
					{
						if(arr[0][current]==-1)
						{
							arr[0][current]=cc;
							cc++;
						}
						//cnt[current]++;
						current=arr[0][current];
						
					}
					cnt[current]++;
					//current.end++;
				}
			}
			public  long query(long w,long k)
			{
			long ans=0;
			int current=root;
			
				for(int i=30;i>=0;i--)
				{
					long bit1=(1<<i) &k;
					long bit2=(1<<i) & w;
					
					
					if(bit1>0)
					{
						
						if(bit2>0)
						{
						
							current=arr[0][current];
						}
						else
						{
							current=arr[1][current];
						
						}
						if(current==-1)
						{
							return ans;
						}
					}
					else
					{
						if(bit2>0)
						{
							if(arr[0][current]!=-1)
							{
								ans+=cnt[arr[0][current]];
							}
							current=arr[1][current];
						}
						else
						{
							if(arr[1][current]!=-1)
							{
								ans+=cnt[arr[1][current]];
							}
							current=arr[0][current];
						}
						if(current==-1)
						{
							return ans;
						}
					}
				}
			ans+=cnt[current];
			return ans;
			}
			
			
	}
	static class trinode
	{
		trinode zero;
		trinode one;
		int end=0;
		trinode()
		{
		}
	}
	
	
	
	
	
	
	
	
	 static class InputReader {

		private InputStream stream;
		private byte[] buf = new byte[8192];
		private int curChar;
		private int snumChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}

			int res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));

			return res * sgn;
		}
		
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}

			long res = 0;

			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));

			return res * sgn;
		}
		
		public String readString() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

}
