from bisect import * N, X = map(int, input().split()) A = [int(input()) for _ in range(N)] A.sort() F = [False] * N ans = 0 for i in range(N): if not F[i]: if X ^ A[i] in A: pos1 = bisect_left(A, X ^ A[i]) pos2 = bisect_right(A, X ^ A[i]) F[pos1:pos2] = [True] * (pos2 - pos1) #print(A[i], X ^ A[i], pos1, pos2) ans += pos2 - pos1 F[i] = True print(ans)