#include <bits/stdc++.h>
using namespace std;
const long long p = 1e9 + 7;
long long qp(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long tmp = qp(x * x % p, y >> 1);
  if (y & 1) tmp *= x, tmp %= p;
  return tmp;
}
int read() {
  int w = 0, f = 1;
  char c = ' ';
  while (c < '0' || c > '9') c = getchar(), f = c == '-' ? -1 : f;
  while (c >= '0' && c <= '9') w = w * 10 + c - 48, c = getchar();
  return w * f;
}
using namespace std;
int e[20000003][2], num[20000003];
int cnt = 1, x, pre;
void add(int a) {
  num[1]++;
  for (int i = 30, p = 1; i >= 0; i--) {
    if (e[p][(a >> i) & 1] == 0) e[p][(a >> i) & 1] = ++cnt;
    p = e[p][(a >> i) & 1], ++num[p];
  }
}
int ask(int a, int k) {
  int res, p = 1;
  res = 0;
  for (int i = 30; i >= 0; i--)
    if ((k >> i) & 1)
      p = e[p][1 - ((a >> i) & 1)];
    else
      res += num[e[p][1 - ((a >> i) & 1)]], p = e[p][(a >> i) & 1];
  return res + num[p];
}
int main() {
  int n = read(), k = read();
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    add(pre), x = read(), pre ^= x, ans += ask(pre, k);
  printf("%lld", ans);
  return 0;
}
