import sys from collections import Counter def input(): return sys.stdin.readline()[:-1] def main(): N, X = map(int,input().split()) A = [int(input()) for _ in range(N)] C = Counter(A) ans = 0 if X != 0: for e in C: if e^X in C: ans += C[e]*C[e^X] C[e^X] = 0 else: for e in C: ans += (C[e]*(C[e]-1))//2 print(ans) if __name__ == '__main__': main()