from collections import Counter n, x = map(int, input().split()) A = [int(input()) for _ in range(n)] counter = Counter(A) seen = set() ans = 0 for val, cnt in counter.items(): if val in seen: continue res = x ^ val if res == val: ans += cnt * (cnt - 1) // 2 else: ans += cnt * counter[res] seen.add(val) seen.add(res) print(ans)