#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1000000000;
const ll LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
struct IOSetup {
  IOSetup() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(12);
  }
} iosetup;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (int i = 0; i < (int)v.size(); i++)
    os << v[i] << (i + 1 == (int)v.size() ? "" : " ");
  return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &x : v) is >> x;
  return is;
}
template <typename T, int MAX_LOG>
struct BinaryTrie {
 public:
  struct Node {
    Node *nxt[2];
    ll ch_cnt;
    Node() : nxt{nullptr, nullptr}, ch_cnt(0) {}
  };
  Node *root;
  BinaryTrie() : root(new Node()) {}
  BinaryTrie(Node *root) : root(root) {}
  void add(const T &bit, int idx = -1, ll cnt = 1, T xor_val = 0) {
    root = add(root, bit, idx, MAX_LOG, cnt, xor_val);
  }
  void erase(const T &bit, T xor_val = 0) { add(bit, -1, -1, xor_val); }
  Node *find(const T &bit, T xor_val = 0) {
    return find(root, bit, MAX_LOG, xor_val);
  }
  ll count(const T &bit, T xor_val = 0) {
    auto node = find(bit, xor_val);
    return node ? node->ch_cnt : 0;
  }
  pair<T, Node *> min_element(T xor_val = 0) {
    assert(root->ch_cnt > 0);
    return kth_element(0, xor_val);
  }
  pair<T, Node *> max_element(T xor_val = 0) {
    assert(root->ch_cnt > 0);
    return kth_element(root->ch_cnt - 1, xor_val);
  }
  pair<T, Node *> kth_element(ll k, T xor_val = 0) {
    assert(0 <= k and k < root->ch_cnt);
    return kth_element(root, k, MAX_LOG, xor_val);
  }
  ll count_less(const T &bit, T xor_val = 0) {
    return count_less(root, bit, MAX_LOG, xor_val);
  }

 private:
  virtual Node *clone(Node *t) { return t; }
  Node *add(Node *t, T bit, int idx, int depth, ll x, T xor_val,
            bool need = true) {
    if (need) t = clone(t);
    if (depth == -1) {
      t->ch_cnt += x;
    } else {
      bool f = (xor_val >> depth) & 1;
      auto &to = t->nxt[f ^ ((bit >> depth) & 1)];
      if (!to) to = new Node(), need = false;
      to = add(to, bit, idx, depth - 1, x, xor_val, need);
      t->ch_cnt += x;
    }
    return t;
  }
  Node *find(Node *t, T bit, int depth, T xor_val) {
    if (depth == -1)
      return t;
    else {
      bool f = (xor_val >> depth) & 1;
      auto &to = t->nxt[f ^ ((bit >> depth) & 1)];
      return to ? find(to, bit, depth - 1, xor_val) : nullptr;
    }
  }
  pair<T, Node *> kth_element(Node *t, ll k, int depth, T xor_val) {
    if (depth == -1)
      return {0, t};
    else {
      bool f = (xor_val >> depth) & 1;
      if ((t->nxt[f] ? t->nxt[f]->ch_cnt : 0) <= k) {
        auto ret =
            kth_element(t->nxt[f ^ 1], k - (t->nxt[f] ? t->nxt[f]->ch_cnt : 0),
                        depth - 1, xor_val);
        ret.first |= T(1) << depth;
        return ret;
      } else
        return kth_element(t->nxt[f], k, depth - 1, xor_val);
    }
  }
  ll count_less(Node *t, const T &bit, int depth, T xor_val) {
    if (depth == -1) return 0;
    ll ret = 0;
    bool f = (xor_val >> depth) & 1;
    if ((bit >> depth) & 1) {
      if (t->nxt[f]) ret += t->nxt[f]->ch_cnt;
      if (t->nxt[f ^ 1])
        ret += count_less(t->nxt[f ^ 1], bit, depth - 1, xor_val);
    } else {
      if (t->nxt[f]) ret += count_less(t->nxt[f], bit, depth - 1, xor_val);
    }
    return ret;
  }
};
signed main() {
  ll n, k;
  cin >> n >> k;
  vector<int> a(n);
  cin >> a;
  vector<int> s(n + 1);
  s[0] = 0;
  for (int i = 0; i < (n); i++) s[i + 1] = (s[i] ^ a[i]);
  BinaryTrie<int, 30> trie;
  vector<ll> naive;
  ll res = 0;
  for (int i = 0; i < (n + 1); i++) {
    res += trie.count_less(k, s[i]);
    trie.add(s[i]);
  }
  cout << n * (n + 1) / 2 - res << endl;
  return 0;
}
