#include <bits/stdc++.h>
using namespace std;
struct node {
  int go[2], sum;
  node(int x0, int x1, int _sum) { go[0] = x0, go[1] = x1, sum = _sum; }
};
node root(-1, -1, 0);
vector<node> t = {root};
int get_sum(int v) { return v == -1 ? 0 : t[v].sum; }
int go(int v, int id) {
  if (t[v].go[id] == -1) {
    t[v].go[id] = t.size();
    t.push_back(node(-1, -1, 0));
  }
  return t[v].go[id];
}
void add(int a) {
  int v = 0;
  for (int bit = 29; bit >= 0; bit--) {
    int x = (a >> bit) & 1;
    v = go(v, x);
    t[v].sum++;
  }
}
int get(int a, int k) {
  int v = 0, ans = 0, bit = 29;
  while (bit >= 0) {
    int x = (a >> bit) & 1, y = (k >> bit) & 1;
    if (x > y) ans += get_sum(t[v].go[0]);
    if ((x ^ 1) > y) ans += get_sum(t[v].go[1]);
    if (t[v].go[x ^ y] == -1) break;
    v = go(v, x ^ y);
    bit--;
  }
  if (bit == -1) ans += t[v].sum;
  return ans;
}
void solve() {
  int n, k;
  cin >> n >> k;
  add(0);
  long long pref = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    int v;
    cin >> v;
    pref = pref ^ v;
    ans += get(pref, k);
    add(pref);
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
  cout.setf(ios::fixed), cout.precision(20);
  solve();
}
