import collections N, X = map(int,input().split()) A = [0]*N for i in range(N): A[i] = int(input()) cards = set(A) cnt = collections.Counter(A) ans = 0 if X != 0: for key, value in cnt.items(): if X^key in cards: ans += value*cnt[key] ans //= 2 else: for key, value in cnt.items(): ans += cnt[key]*(cnt[key]-1)//2 print(ans)