#include <bits/stdc++.h>
using namespace std;
long long a[1000002];
int main() {
  long long n, m;
  while (scanf("%lld%lld", &n, &m) == 2) {
    map<long long, long long> M;
    memset(a, 0, sizeof(a));
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
      M[a[i]]++;
    }
    long long sum = 0;
    for (int i = 1; i <= n; i++) {
      long long ans = a[i] ^ m;
      if (ans != a[i])
        sum += M[ans];
      else {
        sum = sum + M[ans] - 1;
      }
    }
    printf("%lld\n", sum / 2);
  }
}
