import random N,X=map(int,input().split()) A=list(map(int,input().split())) def solve_tri(): data_c=[[0 for j in range(64)] for i in range(4096)] data_bit=[[0 for j in range(6)] for i in range(4096)] cnt=[0 for i in range(4096)] for i in range(N): x,y=A[i]>>6,A[i]%64 data_c[x][y]+=1 cnt[x]+=1 for j in range(6): if y>>j &1: data_bit[x][j]+=1 def all_sum(x,y): res=0 upper_const=(x^y)<<6 res+=upper_const*cnt[x]*cnt[y] for i in range(6): res+=(1<>6): ans+=all_sum(i,j) elif i^j==(X>>6): ans+=convolute(i,j) ans//=2 return ans print(solve_tri())