#include <bits/stdc++.h>
using namespace std;
long long n, m, i, x, a[100005], s[100005], val, cnt;
int main() {
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> x;
    a[x]++;
    s[i] = x;
  }
  cnt = 0;
  for (i = 1; i <= n; i++) {
    val = s[i] ^ m;
    if (val > 100000) {
      continue;
    }
    if (val == s[i] && a[val] > 1) {
      cnt += a[val] - 1;
      a[val]--;
    } else if ((val != s[i] && a[val] >= 1)) {
      cnt += a[val];
      a[s[i]]--;
    }
  }
  cout << cnt;
}
