#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
void sync_stdio() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
struct FAIL {
  FAIL() {
    cout << "CHANGE!!!"
         << "\n";
  }
};
int sz = 0;
const int MAX = 12500000;
int g[MAX][2];
int cnt[MAX];
const int LEN = 30;
void make_trie() {
  cnt[sz] = 0;
  ++sz;
}
void add_trie(const string &tmp) {
  int k = 0;
  for (int j = (0); j < (LEN); ++j) {
    if (k == -1) {
      while (j < int(tmp.size())) {
        cnt[sz] = 1;
        g[sz - 1][tmp[j] - '0'] = sz;
        ++sz;
        ++j;
      }
    } else {
      if (g[k][tmp[j] - '0'] != -1) {
        k = g[k][tmp[j] - '0'];
        ++cnt[k];
      } else {
        g[k][tmp[j] - '0'] = sz;
        cnt[sz] = 1;
        ++sz;
        k = -1;
      }
    }
  }
}
string get(int x) {
  string res;
  for (int i = (0); i < (LEN); ++i) {
    res.push_back('0' + x % 2);
    x /= 2;
  }
  reverse(res.begin(), res.end());
  return res;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  vector<int> v(n);
  for (int i = (0); i < (n); ++i) {
    scanf("%d", &v[i]);
  }
  for (int i = (0); i < (MAX); ++i) {
    for (int j = (0); j < (2); ++j) {
      g[i][j] = -1;
    }
  }
  vector<int> ps = v;
  ps.insert(ps.begin(), 0);
  for (int i = (1); i < (ps.size()); ++i) {
    ps[i + 1] ^= ps[i];
  }
  make_trie();
  add_trie(get(ps[0]));
  long long res = 0;
  int x, tk, tk2, val, minc, maxc, flag, tk3, x3;
  string s;
  for (int j = (1); j < (n + 1); ++j) {
    s = get(ps[j]);
    x = 0;
    tk = 0;
    for (int d = (LEN - 1); d > (-1); --d) {
      flag = 0;
      for (int i = (0); i < (2); ++i) {
        if (g[x][i] == -1) {
          continue;
        }
        val = i ^ (s[LEN - 1 - d] - '0');
        tk2 = tk | (val << d);
        minc = (tk2 & ~((1 << d) - 1));
        maxc = (tk2 | ((1 << d) - 1));
        if (minc < k && k <= maxc) {
          tk3 = tk2;
          x3 = g[x][i];
          flag = 1;
        } else if (k <= minc) {
          res += cnt[g[x][i]];
        }
      }
      if (!flag) {
        break;
      } else {
        x = x3;
        tk = tk3;
      }
    }
    add_trie(s);
  }
  printf(
      "%ll"
      "d",
      res);
  return 0;
}
