#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16777216")
int s[100005];
int a[100005];
int main() {
  memset(s, 0, sizeof(s));
  int n, x;
  cin >> n >> x;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    int y = a[i] ^ x;
    if (y <= 100000) res += s[y];
    s[a[i]]++;
  }
  cout << res << endl;
  return 0;
}
