import sys input = sys.stdin.readline from collections import Counter N,X=map(int,input().split()) A=Counter([int(input()) for i in range(N)]) ANS=0 if X!=0: for a in A: ANS+=A[a]*A[a^X] else: for a in A: ANS+=A[a]*(A[a]-1) print(ANS//2)