n,x=map(int,input().split()) a=[] b=dict() for i in range(n): num=int(input()) a.append(num) if num not in b: b[num]=1 else: b[num]+=1 c=list(set(a)) #print(b) #print(c) ans=0 for i in c: m=x^i if m in b: ans+=b[m]*b[i] print(ans//2)