import itertools n,x=map(int,input().split()) a=[] for i in range(n): num=int(input()) a.append(num) ans=0 for l,r in itertools.combinations(a,2): if(x==(l^r)): ans+=1 print(ans)