One day, ZS the Coder wrote down an array of integers a with elements a1, a2, ..., an.

A subarray of the array a is a sequence al, al + 1, ..., ar for some integers (l, r) such that 1 ≤ l ≤ r ≤ n. ZS the Coder thinks that a subarray of a is beautiful if the bitwise xor of all the elements in the subarray is at least k.

Help ZS the Coder find the number of beautiful subarrays of a!

Input

The first line contains two integers n and k (1 ≤ n ≤ 106, 1 ≤ k ≤ 109) — the number of elements in the array a and the value of the parameter k.

The second line contains n integers ai (0 ≤ ai ≤ 109) — the elements of the array a.

Output

Print the only integer c — the number of beautiful subarrays of the array a.

Examples

Input

3 1
1 2 3


Output

5


Input

3 2
1 2 3


Output

3


Input

3 3
1 2 3


Output

2
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
template <class T, class T2>
inline bool chkmax(T &x, const T2 &y) {
  return x < y ? x = y, 1 : 0;
}
template <class T, class T2>
inline bool chkmin(T &x, const T2 &y) {
  return x > y ? x = y, 1 : 0;
}
template <class T>
inline void sortl(T &a) {
  sort(a.begin(), a.end());
}
template <class T>
inline void sortg(T &a) {
  sort(a.begin(), a.end(), greater<int>());
}
template <class T, class T2>
inline istream &operator>>(istream &is, pair<T, T2> &p) {
  is >> p.first >> p.second;
  return is;
}
template <class T, class T2>
inline ostream &operator<<(ostream &os, const pair<T, T2> &p) {
  os << p.first << ' ' << p.second;
  return os;
}
template <class T>
inline istream &operator>>(istream &is, vector<T> &v) {
  for (auto &curr : v) is >> curr;
  return is;
}
template <class T>
inline ostream &operator<<(ostream &os, const vector<T> &v) {
  for (auto curr : v) os << curr << ' ';
  return os;
}
template <class T, class T2>
inline ostream &operator<<(ostream &os, const map<T, T2> &m) {
  auto id = m.begin();
  while (id != m.end()) os << (*id).first << ' ' << (*(id++)).second;
  return os;
}
template <class T, class T2>
inline ostream &operator<<(ostream &os, const unordered_map<T, T2> &um) {
  auto id = um.begin();
  while (id != um.end()) os << (*id).first << ' ' << (*(id++)).second;
  return os;
}
template <class T>
inline ostream &operator<<(ostream &os, const list<T> &l) {
  auto id = l.begin();
  while (id != l.end()) os << *(id++) << ' ';
  return os;
}
template <class T>
inline ostream &operator<<(ostream &os, const set<T> &second) {
  auto id = second.begin();
  while (id != second.end()) os << *(id++) << ' ';
  return os;
}
template <class T>
inline ostream &operator<<(ostream &os, const unordered_set<T> &us) {
  auto id = us.begin();
  while (id != us.end()) os << *(id++) << ' ';
  return os;
}
template <class T>
inline ostream &operator<<(ostream &os, const multiset<T> &ms) {
  auto id = ms.begin();
  while (id != ms.end()) os << *(id++) << ' ';
  return os;
}
template <class T>
inline ostream &operator<<(ostream &os, const unordered_multiset<T> &mus) {
  auto id = mus.begin();
  while (id != mus.end()) os << *(id++) << ' ';
  return os;
}
template <class T>
inline void inArray(T a[], const int &n) {
  for (int i = 0; i < n; i++) cin >> a[i];
}
template <class T>
inline void outArray(T a[], const int &n) {
  for (int i = 0; i < n; i++) cout << a[i] << ' ';
}
const bool hasTests = 0;
const int MAXA = 1e9;
const int MAXlog = ceil(log2(1e9));
const int MAXpow = 1 << MAXlog;
int n, k;
struct node {
  int cnt = 0;
  int l = 0, r = 0;
};
vector<node> tr;
vector<int> a;
ll cnt;
void add(int a) {
  int p = MAXpow;
  int curr = 1;
  tr[curr].cnt++;
  while (p) {
    if (a & p) {
      if (!tr[curr].r) {
        tr[curr].r = ((int)tr.size());
        tr.emplace_back();
      }
      curr = tr[curr].r;
    } else {
      if (!tr[curr].l) {
        tr[curr].l = ((int)tr.size());
        tr.emplace_back();
      }
      curr = tr[curr].l;
    }
    tr[curr].cnt++;
    p >>= 1;
  }
}
void input() {
  cin >> n >> k;
  a.resize(n);
  tr.emplace_back();
  tr.emplace_back();
  int temp, curr = 0;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    curr ^= temp;
    add(curr);
    a[i] = curr;
  }
}
int solve(int a, int k) {
  int p = MAXpow;
  int curr = 1;
  int cnt = 0;
  bool ch = 0;
  while (p) {
    if (!tr[curr].cnt) {
      break;
    }
    if (k & p) {
      if (a & p) {
        curr = tr[curr].l;
      } else {
        curr = tr[curr].r;
      }
      ch = 1;
    } else {
      if (a & p) {
        cnt += tr[tr[curr].l].cnt;
        curr = tr[curr].r;
      } else {
        cnt += tr[tr[curr].r].cnt;
        curr = tr[curr].l;
      }
    }
    p >>= 1;
  }
  cnt += tr[curr].cnt;
  if (!ch) {
    cnt--;
  }
  return cnt;
}
void start() {
  int t = 1;
  if (hasTests) cin >> t;
  for (int i = 1; i <= t; i++) {
    input();
    for (int j = 0; j < n; j++) {
      cnt += solve(a[j], k);
      if (a[j] >= k) {
        cnt += 2;
      }
    }
    cnt >>= 1;
    cout << cnt << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  start();
  return 0;
}
