N, X = map(int, input().split()) LX = [0 for _ in range(32)] for i in range(32): LX[i] = X % 2 X //= 2 A = [0 for i in range(N)] B = [0 for i in range(N)] for i in range(N): a = int(input()) A[i] = a bas = 1 for j in range(32): B[i] += ((a % 2) + LX[j] - 2 * (a % 2) * LX[j]) * bas a //= 2 bas *= 2 D = {} cnt = 0 for i in range(N): if B[i] in D: D[B[i]] += 1 else: D[B[i]] = 1 for i in range(N): if A[i] in D: cnt += D[A[i]] print(cnt // 2)