n,x=map(int,input().split()) a=[int(input()) for i in range(n)] watch=set([]) ans=0 if x==0: for i in range(n): y=a[i] if not y in watch: cnt=a.count(y) ans+=cnt*(cnt-1)//2 watch.add(y) print(ans) exit() else: for i in range(n): b=x^a[i] ans+=a.count(b) print(ans//2)