#include <bits/stdc++.h>
using namespace std;
struct trie_node {
  int z = -1, s = -1, leaf = 0;
  trie_node() {}
};
vector<int> kk;
long long res;
class trie {
 public:
  vector<trie_node> tr;
  trie() { tr.resize(1); }
  void add(vector<int> &t) {
    int v = 0;
    for (int i = 0; i < 30; i++) {
      tr[v].leaf++;
      if (t[i]) {
        if (tr[v].s == -1) {
          tr[v].s = tr.size();
          tr.emplace_back();
        }
        v = tr[v].s;
      } else {
        if (tr[v].z == -1) {
          tr[v].z = tr.size();
          tr.emplace_back();
        }
        v = tr[v].z;
      }
    }
    tr[v].leaf++;
  }
  int cnt(vector<int> &t) {
    int v = 0;
    int r = 0;
    for (int i = 0; v >= 0 && i < 30; i++) {
      if (kk[i] == 0) {
        if (t[i]) {
          if (tr[v].z >= 0) {
            r += tr[tr[v].z].leaf;
          }
          v = tr[v].s;
        } else {
          if (tr[v].s >= 0) {
            r += tr[tr[v].s].leaf;
          }
          v = tr[v].z;
        }
      } else {
        if (t[i]) {
          v = tr[v].z;
        } else
          v = tr[v].s;
      }
    }
    if (v >= 0) {
      r += tr[v].leaf;
    }
    return r;
  }
};
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i > 0) a[i] ^= a[i - 1];
  }
  vector<int> tmp(30, 0);
  kk.resize(30, 0);
  int i = 29;
  while (k) {
    kk[i] = k & 1;
    i--;
    k >>= 1;
  }
  trie tr;
  tr.add(tmp);
  for (int i = 0; i < n; i++) {
    int t = a[i];
    int j = 29;
    while (t > 0) {
      tmp[j--] = t & 1;
      t >>= 1;
    }
    while (j >= 0) {
      tmp[j--] = 0;
    }
    tr.add(tmp);
  }
  res = 0;
  fill(begin(tmp), end(tmp), 0);
  res += tr.cnt(tmp);
  for (int i = 0; i < n; i++) {
    int t = a[i];
    int j = 29;
    while (t > 0) {
      tmp[j--] = t & 1;
      t >>= 1;
    }
    while (j >= 0) {
      tmp[j--] = 0;
    }
    res += tr.cnt(tmp);
  }
  cout << res / 2 << endl;
  return 0;
}
