N, X = map(int,input().split()) A = [0]*N for i in range(N): A[i] = int(input()) cnt = {} ans = 0 for a in A: if a^X in cnt: ans += cnt[a^X] if a not in cnt: cnt[a] = 1 else: cnt[a] += 1 print(ans)