n,x=map(int,input().split()) a=[int(input()) for _ in range(n)] from collections import Counter ans=0 b=Counter(a) if x==0: for key,val in b.items(): ans+=val*(val-1)//2 print(ans) exit() for i in a: if i^x in b: ans+=b[i^x] print(ans//2)