from itertools import combinations n,x=map(int,input().split()) a=[int(input()) for _ in range(n)] ans=0 for i in range(n-1): ans+=a[i+1:].count(x^a[i]) print(ans)