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;
long long POW(long long A, long long N, long long MOD) {
  if (N == 0) return 1 % MOD;
  if (N == 1) return A % MOD;
  long long tmp = POW(A, N / 2, MOD) % MOD;
  if (N % 2)
    return ((tmp * tmp) % MOD * A % MOD) % MOD;
  else
    return (tmp * tmp) % MOD;
}
long long MUL(long long A, long long B, long long MOD) {
  long long r = 0;
  while (B) {
    r = (r + (A * (B % 2) % MOD)) % MOD;
    A = (A + A) % MOD;
    B /= 2;
  }
  return r;
}
long long GCD(long long A, long long B) { return B == 0 ? A : GCD(B, A % B); }
int dx[] = {0, -1, 0, 1, 0};
int dy[] = {0, 0, 1, 0, -1};
template <class X, class Y>
bool minimize(X &x, const Y &y) {
  X eps = 1e-9;
  if (x > y + eps) {
    x = y;
    return true;
  } else
    return false;
}
template <class X, class Y>
bool maximize(X &x, const Y &y) {
  X eps = 1e-9;
  if (x + eps < y) {
    x = y;
    return true;
  } else
    return false;
}
template <class T>
T Abs(const T &x) {
  return (x < 0 ? -x : x);
}
const int MAXN = 1e6 + 100;
int N, K;
int A[MAXN];
struct Node {
  long long cnt[2];
  Node *next[2];
  Node() {
    cnt[0] = cnt[1] = 0;
    next[0] = next[1] = nullptr;
  }
};
struct TRIE {
  Node *root = new Node();
  void Add(int val) {
    Node *cur = root;
    for (int k = (30), _a = (0); k >= _a; --k) {
      int bit = (((val) >> (k)) & 1ll);
      if (cur->next[bit] == nullptr) cur->next[bit] = new Node();
      ++cur->cnt[bit];
      cur = cur->next[bit];
    }
  }
  long long CALC(int &val) {
    Node *cur = root;
    int num = 0;
    long long ANS = 0;
    for (int k = (30), _a = (0); k >= _a; --k) {
      int bit = (((val) >> (k)) & 1ll);
      if (((num | (1ll << k))) >= K) {
        if (cur->next[(bit + 1) % 2] != nullptr) ANS += cur->cnt[(bit + 1) % 2];
        if (cur->next[bit] != nullptr)
          cur = cur->next[bit];
        else
          break;
      } else {
        if (cur->next[(bit + 1) % 2] != nullptr)
          cur = cur->next[(bit + 1) % 2];
        else
          break;
        num = (num | (1ll << k));
      }
    }
    return ANS;
  }
} TRIE;
void SOLVE() {
  TRIE.Add(0);
  int f = 0;
  long long ANS = 0;
  for (int i = (1), _b = (N); i <= _b; ++i) {
    f ^= A[i];
    long long RES = TRIE.CALC(f);
    ANS += RES;
    TRIE.Add(f);
  }
  cout << ANS << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> N >> K;
  for (int i = (1), _b = (N); i <= _b; ++i) cin >> A[i];
  SOLVE();
  return 0;
}
