#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000000,102400000000")
const long long MOD = 1000000007;
const int N = 1e6 + 15;
const int maxn = 1e6 + 15;
const int letter = 130;
const int INF = 1e9;
const double pi = acos(-1.0);
const double eps = 1e-10;
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, k, ch[18 * N][2], cnt = 1, num[18 * N];
void update(int x) {
  int id = 1, t;
  for (int i = 29; i >= 0; i--) {
    t = (x >> i) & 1;
    if (!ch[id][t]) ch[id][t] = ++cnt;
    id = ch[id][t];
    num[id]++;
  }
}
int query(int x, int y) {
  int ans = 0, id = 1, t;
  for (int i = 29; i >= 0; i--) {
    int t = (x >> i) & 1, p = (y >> i) & 1;
    if (p == 0) {
      if (ch[id][!t]) ans += num[ch[id][!t]];
      id = ch[id][t];
    } else
      id = ch[id][!t];
    if (!id) break;
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &k);
  n++;
  long long sum = 0;
  update(0);
  int y = 0, x;
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x), y ^= x;
    sum += 1ll * query(y, k - 1);
    update(y);
  }
  printf("%I64d\n", sum);
  return 0;
}
