There are some beautiful girls in Arpa’s land as mentioned before.

Once Arpa came up with an obvious problem:

Given an array and a number x, count the number of pairs of indices i, j (1 ≤ i < j ≤ n) such that <image>, where <image> is bitwise xor operation (see notes for explanation).

<image>

Immediately, Mehrdad discovered a terrible solution that nobody trusted. Now Arpa needs your help to implement the solution to that problem.

Input

First line contains two integers n and x (1 ≤ n ≤ 105, 0 ≤ x ≤ 105) — the number of elements in the array and the integer x.

Second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 105) — the elements of the array.

Output

Print a single integer: the answer to the problem.

Examples

Input

2 3
1 2


Output

1

Input

6 1
5 1 2 3 4 1


Output

2

Note

In the first sample there is only one pair of i = 1 and j = 2. <image> so the answer is 1.

In the second sample the only two pairs are i = 3, j = 4 (since <image>) and i = 1, j = 5 (since <image>).

A bitwise xor takes two bit integers of equal length and performs the logical xor operation on each pair of corresponding bits. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1. You can read more about bitwise xor operation here: <https://en.wikipedia.org/wiki/Bitwise_operation#XOR>.

import java.util.*;
import java.io.*;

public class marte{


private int contor=0;
private int raspuns=0;

public static void main (String args[]) throws Exception{

Scanner input=new Scanner(System.in);

HashMap<String, Integer> harta= new HashMap<String, Integer>();
HashMap<String, Integer> map1= new HashMap<String, Integer>();
HashMap<Integer, Integer> map= new HashMap<Integer, Integer>();
HashMap<Integer, Integer> maxime= new HashMap<Integer, Integer>();
HashMap<Integer, String> suplim= new HashMap<Integer, String>();
	
				//	System.out.println(bazazece("101"));
					
					int n=input.nextInt();
					int xx=input.nextInt();
					
					int v[]=new int[100001];
					
					String x=bazadoi(xx);
					
					Long contor=0L;
					Long rez=0L;
					Long reza=0L;
					
					
					
					for(int i=0;i<n;i++){
					    
					    int citire=input.nextInt();
					    v[citire]++;
					    
					    
					    
					}
					
				//	System.out.println(v[1]+ " "+v[5]);
					
					for(int i=0;i<=100000;i++){
					    
					    if(v[i]>0){
					        
					       String result=functie(bazadoi(i),x);
					    //   System.out.println(bazazece(result)+" "+i);
					       
					        if(bazazece(result)>=0 && bazazece(result)<=100000)
					        {
					       if(xx==0) {
					       
					        rez=v[i]*1L;
					        reza=rez-1;
					        rez=rez*reza;
					        rez=rez/2L;
					        
					        contor+=rez;
					        
				//	     if(n==100000) System.out.println(v[i]+" "+contor+" "+rez);
					       }
					       else{
					           
					           
					           
					       rez=v[i]*1L;
					       reza=v[bazazece(result)]*1L;
					       rez=rez*reza;
					       
					       contor+=rez;
					       
					        }
					     //   System.out.println("contor="+contor);
					        
					        
					    }
					    
					    
					    
					}
					
					}
					
				if(xx==0) System.out.println(contor)		;
				else System.out.println(contor/2);
			
					
            }
					
					public static String bazadoi(int a){
					
					String result="";
					String part;
					
					while(a>=2){
					
					int rest=a%2;
					a=a/2;
					 part=String.valueOf(rest);
					result+=part;
					
					}
					part=String.valueOf(a);
					
					result+=part;
					
					String raspuns="";
					
					for(int i=result.length()-1;i>=0;i--) 
					raspuns+=result.substring(i,i+1);
					
					return raspuns;
					
					}
					
					
					
					public static String functie(String a,String b){
					    
					    // System.out.println("a="+a+" b="+b);
					    String completare="";
					    
					    int len=0;
					    
					    if(a.length()>b.length()) {len=a.length()-b.length();
					    for(int i=1;i<=len;i++) completare+="0";
					    
					    b=completare+b;}
					    
					else     if(a.length()<b.length()) {len=b.length()-a.length();
					    for(int i=1;i<=len;i++) completare+="0";
					    
					    a=completare+a;} 
					    
					   // System.out.println("a="+a+" b="+b);
					    
					    
					    String result="";
					    for(int i=0;i<a.length();i++)
					    if(a.charAt(i)!=b.charAt(i)) result+="1";
					    else result+="0";
					    
					    
					    return result;
					    
					    
					    
					    
					    
					}
					
					public static int bazazece(String a){
					    
					    int lungime=a.length()-1;
					    int raspuns=0;
					    
					    for(int i=lungime;i>=0;i--) {
					        
					        int c=Integer.parseInt(a.substring(i,i+1));
					        raspuns+=putere(2,lungime-i)*c;
					        
					    }
					    
					    return raspuns;
					}
					
					public static int putere(int baza,int putere){
					    
					    if(putere==0) return 1;
					    else return baza*putere(baza,putere-1);
					    
					    
					}
					
					public static int  factorial(int a){
					    
					    if(a==1) return 1;
					    else return a*factorial(a-1);
					    
					    
					    
					}
				
					
					}
				
			
			
	
		
