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;
template <typename T, typename S>
inline bool REMIN(T &a, const S &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T, typename S>
inline bool REMAX(T &a, const S &b) {
  return a < b ? a = b, 1 : 0;
}
long long toint(const string &s) {
  stringstream ss;
  ss << s;
  long long x;
  ss >> x;
  return x;
}
string tostring(long long num) {
  stringstream ss;
  ss << num;
  return ss.str();
}
int bit(long long x, int pos) { return (x >> pos) & 1; }
long long power(long long base, long long exp, long long c = 1e9 + 7) {
  if (!exp) return 1;
  long long r = power(base, exp >> 1, c);
  r = (r * r) % c;
  if (exp & 1) r = (r * base) % c;
  return r;
}
void nope(int dec = 0) {
  if (!dec)
    cout << "NO";
  else
    cout << dec;
  exit(0);
}
const long double PI = 2 * acos(0);
const long long INF = 1e9;
const int NMAX = 3e5 + 5;
const long long MOD = 1000000007;
long long T, N, M;
int a, b, c;
string s1, s2;
struct node {
  int val[2] = {0, 0};
  int cnt = 0;
} emp;
vector<node> trie;
void ins(int x) {
  int k = 0;
  for (int(i) = int(30); (i) >= int(0); --(i)) {
    int bi = (x >> i) & 1;
    if (!trie[k].val[bi]) {
      trie[k].val[bi] = ((int)(trie.size()));
      trie.push_back(emp);
    }
    k = trie[k].val[bi];
    trie[k].cnt++;
  }
}
int calc(int x) {
  int k = 0;
  int ret = 0;
  for (int(i) = int(30); (i) >= int(0); --(i)) {
    int mbi = (M >> i) & 1;
    int bi = (x >> i) & 1;
    if (mbi) {
      k = trie[k].val[bi ^ 1];
      if (!k) return ret;
    } else {
      ret += trie[trie[k].val[bi ^ 1]].cnt;
      k = trie[k].val[bi];
      if (!k) return ret;
    }
  }
  return ret + trie[k].cnt;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  trie.push_back(emp);
  ins(0);
  cin >> N >> M;
  long long ans = 0, s = 0;
  for (int(i) = int(1); (i) <= int(N); ++(i)) {
    cin >> a;
    s ^= a;
    ans += calc(s);
    ins(s);
  }
  cout << ans;
  return 0;
}
