from collections import Counter n, x = map(int, input().split()) a = [int(input()) for i in range(n)] a.sort() c = Counter(a) ans = 0 for i in range(n - 1): if a[i] ^ a[i + 1] == x: ans += c[a[i]] * c[a[i + 1]] print(ans)