#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int maxc = 1000000 * 20 + 5;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-8;
int n, k, x, a[35], b[35], sum;
int ch[maxc][2], cnt[maxc], tot, root;
int newNode() {
  ch[tot][0] = 0;
  ch[tot][1] = 0;
  cnt[tot] = 0;
  return tot++;
}
void init() {
  tot = 0;
  root = newNode();
}
void insert(int x) {
  int u = root;
  for (int i = 31; i >= 0; i--) {
    int c = (x >> i) & 1;
    if (!ch[u][c]) ch[u][c] = newNode();
    u = ch[u][c];
    cnt[u]++;
  }
}
int query(int x) {
  int ret = 0, u = root;
  for (int i = 31; i >= 0; i--) {
    int c = (x >> i) & 1;
    if ((k >> i) & 1)
      u = ch[u][!c];
    else
      ret += cnt[ch[u][!c]], u = ch[u][c];
    if (!u) break;
  }
  ret += cnt[u];
  return ret;
}
int main() {
  init();
  scanf("%d%d", &n, &k);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    insert(sum);
    scanf("%d", &x);
    ans += query(sum ^= x);
  }
  printf("%I64d\n", ans);
  return 0;
}
