n,x = map(int, input().split()) a = [int(input()) for _ in range(n)] # print(a) a.sort() ans = 0 d = {} for i in a: tmp = str(i) if tmp not in d: d[tmp] = 1 else: d[tmp] += 1 # print(d) for i in d: tmp = str(int(i) ^ x) if tmp in d: ans += d[i] * d[tmp] d[tmp] = 0 print(ans)