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>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
const double EPS = 1e-15;
const double PI = acos(-1.0);
const int MAXN = (int)1e6 + 7;
const int LOGN = 30;
const int INF = (int)1e9 + 7;
const long long LINF = (long long)2e18 + 7;
const int MOD = (int)1e9 + 7;
const unsigned long long P = 239017;
const unsigned long long MM = (unsigned long long)2147482661;
int solve();
int main() { return solve(); }
struct Bnode {
  int to[2], quant;
  Bnode() { to[0] = to[1] = quant = 0; }
};
int getbit(int x, int i) { return (x >> i) & 1; }
int n, k;
class Bor {
 private:
  vector<Bnode> b;

 public:
  void add(int x) {
    int v = 0;
    for (int i = LOGN; i >= 0; i--) {
      int bit = getbit(x, i);
      if (b[v].to[bit]) {
        v = (b[v].to[bit]);
      } else {
        v = b[v].to[bit] = b.size();
        b.push_back(Bnode());
      }
      b[v].quant++;
    }
  }
  Bor() {
    b.resize(1);
    this->add(0);
  }
  int get(int x) {
    int v = 0, ans = 0, cur = 0;
    for (int i = LOGN; i >= 0; i--) {
      int bit = getbit(x, i);
      int ncur = cur | (1 << i);
      if (ncur >= k) {
        int tov = b[v].to[!bit];
        ans += b[tov].quant;
        v = b[v].to[bit];
      } else {
        cur = ncur;
        v = b[v].to[!bit];
      }
      if (!v) break;
    }
    return ans;
  }
};
int a[MAXN], prefxor[MAXN];
int solve() {
  cin >> n >> k;
  for (int i = 1; i <= (int)n; i++) {
    scanf("%d", a + i);
    prefxor[i] = prefxor[i - 1] ^ a[i];
  }
  Bor mybor;
  long long answer = 0;
  for (int i = 1; i <= (int)n; i++) {
    int dt = mybor.get(prefxor[i]);
    answer += dt;
    mybor.add(prefxor[i]);
  }
  cout << answer;
  return 0;
}
