#include <bits/stdc++.h>
using namespace std;
struct Node {
  Node *child[2];
  int cnt = 0;
  Node() { child[0] = child[1] = NULL; }
} *root = new Node();
void upd(int s) {
  Node *u = root;
  for (int i = 30; i >= 0; i--) {
    int h = ((s >> i) & 1);
    if (u->child[h] == NULL) u->child[h] = new Node();
    u = u->child[h];
    u->cnt++;
  }
  return;
}
int n, k, a[1000005];
long long ans;
int get(int s) {
  Node *u = root;
  int res = 0;
  for (int i = 30; i >= 0; i--) {
    int h = ((s >> i) & 1);
    int t = ((k >> i) & 1);
    if (t == 0) {
      if (u->child[h ^ 1] != NULL) res += u->child[h ^ 1]->cnt;
      if (i == 0 && u->child[h] != NULL) res += u->child[h]->cnt;
      if (u->child[h] == NULL) return res;
      u = u->child[h];
    } else {
      if (u->child[h ^ 1] == NULL) return res;
      if (i == 0) res += u->child[h ^ 1]->cnt;
      u = u->child[h ^ 1];
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] = a[i] ^ a[i - 1];
    upd(a[i - 1]);
    ans += 1ll * get(a[i]);
  }
  cout << ans;
}
