import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from collections import defaultdict n,x = map(int,readline().split()) a = list(map(int,read().split())) ans = 0 d = defaultdict(int) for i in a: ans += d[i^x] d[i] += 1 print(ans)