#include <bits/stdc++.h>
template <typename Tp>
Tp Max(const Tp &a, const Tp &b) {
  return a > b ? a : b;
}
template <typename Tp>
Tp Min(const Tp &a, const Tp &b) {
  return a < b ? a : b;
}
template <typename Tp>
void Read(Tp &x) {
  Tp in = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    in = in * 10 + ch - '0';
    ch = getchar();
  }
  x = in * f;
}
const int SN = 3000000 + 10;
int ch[SN << 2][2], size[SN << 2], cnt;
int a[SN], n, k;
long long ans;
void insert(int d) {
  int now = 0;
  for (int i = 31; i >= 1; i--) {
    int to = ((d >> (i - 1)) & 1);
    if (!ch[now][to]) ch[now][to] = ++cnt;
    now = ch[now][to], size[now]++;
  }
}
int Ask(int d) {
  int now = 0;
  int ans = 0;
  for (int i = 31; i >= 1; i--) {
    int net = ((d >> (i - 1)) & 1);
    int pre = ((k >> (i - 1)) & 1);
    if (pre == 1)
      now = ch[now][net ^ 1];
    else
      ans += size[ch[now][net ^ 1]], now = ch[now][net];
    if (now == 0) break;
  }
  ans += size[now];
  return ans;
}
int main() {
  long long ans = 0;
  Read(n), Read(k);
  insert(0);
  for (int i = 1; i <= n; i++) {
    Read(a[i]);
    long long pre = ans;
    a[i] ^= a[i - 1];
    ans += 1LL * Ask(a[i]);
    insert(a[i]);
  }
  printf("%I64d\n", ans);
  return 0;
}
