#include <bits/stdc++.h>
using namespace std;
inline long long int power(long long int a, long long int p) {
  long long int res = 1, x = a;
  while (p) {
    if (p & 1) res = (res * x);
    x = (x * x);
    p >>= 1;
  }
  return res;
}
int arr[1000010];
int freq[1000010];
int flag[1000010];
int main() {
  for (int i = 0; i < 1000000; i++) freq[i];
  int n;
  int x;
  int a = 0;
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    freq[arr[i]]++;
  }
  long long int cnt = 0;
  int r;
  for (int i = 0; i < n; i++) {
    r = arr[i] ^ x;
    cnt = cnt + freq[r];
    if (arr[i] == r) cnt--;
  }
  cout << cnt / 2 << endl;
}
