n, x = map(int, input().split()) a = [] for _ in range(n): a.append(int(input())) a = sorted(a) b = sorted([i ^ x for i in a]) i = j = c = 0 while i < n and j < n: if a[i] < b[j]: i += 1 elif a[i] > b[j]: j += 1 else: i0 = i while i < n and a[i] == a[i0]: i += 1 j0 = j while j < n and b[j] == b[j0]: j += 1 c += (i - i0) * (j - j0 - (x == 0)) print(c // 2)