#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5;
unordered_set<long long> s;
unordered_map<long long, long long> m;
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(0);
  long long n, x;
  cin >> n >> x;
  for (int i = 0; i < n; ++i) {
    long long a;
    cin >> a;
    v.push_back(a);
    s.insert(a);
    ++m[a];
  }
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    --m[v[i]];
    if (m[v[i]] == 0) {
      s.erase(v[i]);
    }
    if (s.count(v[i] ^ x)) {
      ans += m[v[i] ^ x];
    }
  }
  cout << ans;
  return 0;
}
