from collections import defaultdict d = defaultdict(int) n,x = map(int,input().split()) L = [] for i in range(n): a = int(input()) L.append(a) d[a] += 1 ans = 0 for i in range(n): ax = L[i] if d[ax^x] > 0 and ax^x != ax: ans += d[ax^x] elif d[ax^x] > 1 and ax^x == ax: ans += d[ax^x]-1 print(ans//2)