import sys input = sys.stdin.readline from collections import * N, X = map(int, input().split()) A = [int(input()) for _ in range(N)] cnt = Counter(A) ans = 0 for i in range(N): pair = A[i]^X ans += cnt[pair] if A[i]==pair: ans -= 1 print(ans//2)