import collections N,X = map(int,input().split()) L = [] for i in range(N): L.append(int(input())) CL = collections.Counter(L) ans = 0 if X!=0: for k,v in CL.items(): ans += v * CL[k^X] ans = ans//2 else: for k,v in CL.items(): ans += v * (v-1) //2 print(ans)