#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int g[30000010][2];
struct Trie {
  const static int ALPHA_SIZE = 2;
  vector<int> pref, words;
  int nxt = 1;
  int move_to(int u, int c) {
    if (g[u][c] == -1) {
      g[u][c] = nxt++;
      pref.push_back(0);
      words.push_back(0);
    }
    pref[g[u][c]]++;
    return g[u][c];
  }

 public:
  Trie() {
    pref.push_back(0);
    words.push_back(0);
  }
  void addBit(int a) {
    int u = 0;
    for (int i = 30; i >= 0; i--) u = move_to(u, bool(a & (1ll << i)));
    words[u]++;
  }
  int query(int k, int cota) {
    int u = 0, ans = 0;
    for (int i = 30; i >= 0 && u != -1; i--) {
      if ((k & (1 << i)) && !(cota & (1 << i)) && g[u][0] != -1)
        ans += pref[g[u][0]], u = g[u][1];
      else if ((k & (1 << i)) && !(cota & (1 << i)) && g[u][0] == -1)
        u = g[u][1];
      else if (!(k & (1 << i)) && !(cota & (1 << i)) && g[u][1] != -1)
        ans += pref[g[u][1]], u = g[u][0];
      else if (!(k & (1 << i)) && !(cota & (1 << i)) && g[u][1] == -1)
        u = g[u][0];
      else if ((k & (1 << i)) && (cota & (1 << i)))
        u = g[u][0];
      else if (!(k & (1 << i)) && (cota & (1 << i)))
        u = g[u][1];
    }
    if (u + 1) ans += words[u];
    return ans;
  }
};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k, aux, x = 0;
  cin >> n >> k;
  memset(g, -1, sizeof(g));
  Trie trie;
  trie.addBit(0);
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> aux;
    x ^= aux;
    ans += trie.query(x, k);
    trie.addBit(x);
  }
  cout << ans << "\n";
}
