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 for key, value in cnt.items(): if X^key in cards: ans += value*cnt[key] print(ans//2)