#include <bits/stdc++.h>
using namespace std;
int n, x;
int a[100010];
map<int, int> vis;
int main() {
  while (cin >> n >> x) {
    memset(a, 0, sizeof(a));
    vis.clear();
    for (int i = (1); i <= (n); ++i) {
      cin >> a[i];
      vis[a[i]]++;
    }
    long long ans = 0;
    if (x == 0) {
      for (int i = (1); i <= (n); ++i) {
        ans += vis[a[i]] - 1;
        vis[a[i]]--;
      }
    } else {
      for (int i = (1); i <= (n); ++i) {
        ans += vis[a[i] ^ x];
        vis[a[i]]--;
      }
    }
    cout << ans << endl;
  }
}
