import sys input=sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) mod=10**9+7 def main(): N,X=MI() A=[0]*N B=[0]*N from collections import defaultdict ddA = defaultdict(int) ddB = defaultdict(int) for i in range(N): A[i]=I() ddA[A[i]]+=1 B[i]=A[i]^X ddB[B[i]]+=1 ans=0 for k,v in ddA.items(): ans+=v*ddB[k] print(ans//2) main()