#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int MAXN = 1000;
const int MAXM = 1000;
long long pow_mod(long long a, long long n, long long mod) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
struct Edge {
  int to;
  int next;
  int cal;
} edge[MAXM];
int head[MAXN], tot;
void addedge(int u, int v, int cal) {
  edge[tot].to = v;
  edge[tot].cal = cal;
  edge[tot].next = head[u];
  head[u] = tot++;
}
void init() {
  tot = 0;
  memset(head, -1, sizeof head);
}
struct Matrix {
  int m[10][10];
  int n;
  void E() {
    for (int i = 0; i < 10; i++)
      for (int j = 0; j < 10; j++) m[i][j] = i == j;
  }
  void clear() { memset(m, 0, sizeof m); }
  Matrix operator*(const Matrix b) {
    Matrix res;
    res.n = b.n;
    res.clear();
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) {
        res.m[i][j] = 0;
        for (int k = 0; k < n; k++)
          res.m[i][j] = (res.m[i][j] + m[i][k] * b.m[k][j] % mod) % mod;
      }
    return res;
  }
  Matrix operator^(long long tim) {
    Matrix a = *this;
    Matrix res;
    res = a;
    res.E();
    while (tim) {
      if (tim & 1) res = res * a;
      a = a * a;
      tim >>= 1;
    }
    return res;
  }
};
int cot[300000 + 10];
int main() {
  memset(cot, 0, sizeof cot);
  int n;
  int m;
  cin >> n >> m;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    long long plus = m ^ x;
    ans += (long long)cot[plus];
    cot[x]++;
  }
  cout << ans;
}
