#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int N = 1000010;
const int M = 1e5 + 7;
const int HASHSIZE = 3e5 + 9;
const int mod = 100000000;
const int MOD1 = 1000000007;
const int MOD2 = 1000000009;
const double EPS = 0.00000001;
const long long MOD = 1000000007;
const int INF = ~0u >> 1;
const long long MAX = 1ll << 55;
const double pi = acos(-1.0);
int tot, K[30], siz[20 * N], tr[20 * N][2];
void add(int x) {
  int i, d, w = 0;
  siz[0]++;
  for (i = 29; i >= 0; i--) {
    d = x >> i & 1;
    if (tr[w][d])
      w = tr[w][d], siz[w]++;
    else
      tr[w][d] = ++tot, w = tot, siz[w] = 1;
  }
}
int get(int x) {
  int i, d, w = 0, ret = 0;
  for (i = 29; i >= 0; i--) {
    d = x >> i & 1;
    if (!K[i] && tr[w][!d]) ret += siz[tr[w][!d]];
    if (K[i])
      w = tr[w][!d];
    else
      w = tr[w][d];
    if (!w) break;
  }
  return ret;
}
int main() {
  int a, b, i, n, k;
  long long ans = 0;
  scanf("%d%d", &n, &k);
  k--;
  a = b = tot = 0;
  add(b);
  for (i = 0; i < 30; i++) K[i] = k >> i & 1;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a);
    b ^= a;
    ans += (long long)get(b);
    add(b);
  }
  printf("%I64d\n", ans);
  return 0;
}
