from collections import Counter N,X = map(int,input().split()) A = [int(input()) for _ in range(N)] mapA = Counter(A) B = [] ans = 0 for a in A: B.append(a^X) for b in B: if b in mapA: ans += mapA[b] if b^b == X: ans -= 1 print(ans//2)