from collections import Counter
import sys
input = sys.stdin.readline
n, x = map(int, input().split())
a = [int(input()) for _ in range(n)]
c = Counter(a)
ans = 0
if x == 0:
    for k, v in c.items():
        ans += (v * (v - 1) // 2)
else:
    for k, v in c.items():
        if k ^ x in c:
            ans += v * c[k ^ x]
    ans //= 2
print(ans)