#include <bits/stdc++.h>
using namespace std;
const int maxn = 20;
const int maxnode = 2e7 + 10;
int n, k;
int ch[maxnode][2];
int val[maxnode];
int sz;
void init() {
  sz = 2;
  memset(ch[0], 0, sizeof(ch[0]));
  memset(val, 0, sizeof(val));
}
void add(int x) {
  int p = 1;
  for (int i = 30; i >= 0; i--) {
    int id = (x >> i) & 1;
    if (ch[p][id] == 0) {
      memset(ch[sz], 0, sizeof(ch[sz]));
      ch[p][id] = sz++;
    }
    p = ch[p][id];
    val[p]++;
  }
}
int match(int x) {
  int u = 1, i;
  long long ans = 0;
  for (i = 30; i >= 0; i--) {
    int p = (x >> i) & 1;
    int q = (k >> i) & 1;
    if (q == 0)
      ans += val[ch[u][p ^ 1]], u = ch[u][p];
    else
      u = ch[u][p ^ 1];
  }
  return ans + val[u];
}
int main() {
  init();
  scanf("%d%d", &n, &k);
  int pre = 0;
  long long ans = 0;
  add(0);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    pre ^= x;
    ans += match(pre);
    add(pre);
  }
  cout << ans << endl;
}
