from collections import defaultdict n, x = map(int, input().split()) a = [int(input()) for _ in range(n)] ans = 0 if x == 0: c = defaultdict(int) for i in range(n): c[a[i]] += 1 for i, m in c.items(): ans += m*(m-1)//2 print(ans) else: c1 = defaultdict(int) c2 = defaultdict(int) for i in range(n): c1[a[i]] += 1 c2[a[i]^x] += 1 for i, m in c1.items(): ans += m*c2[i] print(ans//2)