#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
const double EPS = 1e-15;
const double PI = acos(-1.0);
const int MAXN = (int)1e6 + 7;
const int LOGN = 30;
const int INF = (int)1e9 + 7;
const long long LINF = (long long)2e18 + 7;
const int MOD = (int)1e9 + 7;
const unsigned long long P = 239017;
const unsigned long long MM = (unsigned long long)2147482661;
int solve();
int main() { return solve(); }
struct Bnode {
  int to[2], quant;
  Bnode() { to[0] = to[1] = quant = 0; }
};
int getbit(int x, int i) { return (x >> i) & 1; }
int n, k;
class Bor {
 private:
  vector<Bnode> b;

 public:
  void add(int x) {
    int v = 0;
    for (int i = LOGN; i >= 0; i--) {
      int bit = getbit(x, i);
      if (b[v].to[bit]) {
        v = (b[v].to[bit]);
      } else {
        v = b[v].to[bit] = b.size();
        b.push_back(Bnode());
      }
      b[v].quant++;
    }
  }
  Bor() {
    b.resize(1);
    this->add(0);
  }
  int get(int x) {
    int v = 0, ans = 0, cur = 0;
    for (int i = LOGN; i >= 0; i--) {
      int bit = getbit(x, i);
      int ncur = cur | (1 << i);
      if (ncur >= k) {
        int tov = b[v].to[!bit];
        ans += b[tov].quant;
        v = b[v].to[bit];
      } else {
        cur = ncur;
        v = b[v].to[!bit];
      }
      if (!v) break;
    }
    return ans;
  }
};
int a[MAXN], prefxor[MAXN];
int solve() {
  cin >> n >> k;
  for (int i = 1; i <= (int)n; i++) {
    scanf("%d", a + i);
    prefxor[i] = prefxor[i - 1] ^ a[i];
  }
  Bor mybor;
  long long answer = 0;
  for (int i = 1; i <= (int)n; i++) {
    int dt = mybor.get(prefxor[i]);
    answer += dt;
    mybor.add(prefxor[i]);
  }
  cout << answer;
  return 0;
}
