#include <bits/stdc++.h>
using namespace std;
const long long N = 100010;
long long n, s, a[N], cnt[N], ans;
int main() {
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    long long k = s ^ a[i];
    if (k >= N) continue;
    if (k != a[i])
      ans += cnt[k];
    else
      ans += cnt[k] - 1;
  }
  ans /= 2;
  cout << ans;
  return 0;
}
