N,X=map(int,input().split()) D={} for i in range(N): A=int(input()) if A not in D: D[A]=1 else: D[A]+=1 ans=0 if X==0: for k,v in D.items(): ans+=v*(v-1) print(ans//2) else: for k,v in D.items(): if X^k in D: ans+=D[X^k]*v print(ans//2)