n,x=map(int,input().split()) a=[] for i in range(n): num=int(input()) a.append(num) a.sort() ans=0 for i in range(n): m=x^a[i] if m not in a[i+1:]: continue for j in a[i+1:]: if m==j: ans+=1 print(ans)