import bisect n, x = map(int, input().split()) a = [int(input()) for _ in range(n)] b = [a[i]^x for i in range(n)] b.sort() ans = 0 for i in range(n): ans += bisect.bisect_right(b, a[i]) - bisect.bisect_left(b, a[i]) ans //= 2 if x == 0: ans -= n print(ans)