N, X = map(int, input().split()) A = [int(input()) for _ in range(N)] d = {} for a in A: d.setdefault(a, 0) d[a] += 1 ans = 0 if X == 0: for v in d.values(): ans += v * (v - 1) // 2 print(ans) else: for k in d: if k ^ X in d: ans += d[k] * d[k ^ X] print(ans // 2)