import sys from collections import defaultdict read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, X, *A = map(int, read().split()) answer = 0 counter = defaultdict(int) for x in A: answer += counter[x ^ X] counter[x] += 1 print(answer)