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 gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long power(long long first, unsigned long long second,
                unsigned long long m) {
  if (second == 0) return 1;
  long long p = power(first, second / 2, m) % m;
  p = (p * p) % m;
  return (second % 2 == 0) ? p : (first * p) % m;
}
long long modInverse(long long a, long long m) {
  { return power(a, m - 2, m); }
}
const long long maxn = 500004;
typedef struct trie {
  typedef struct node {
    node* nxt[2];
    long long cnt = 0;
    node() {
      nxt[0] = nxt[1] = NULL;
      cnt = 0;
    }
  } Node;
  Node* head;
  trie() { head = new Node(); }
  void insert(long long first) {
    Node* cur = head;
    for (long long i = 30; i >= 0; i--) {
      long long b = (first >> i) & 1;
      if (!cur->nxt[b]) cur->nxt[b] = new Node();
      cur = cur->nxt[b];
      cur->cnt++;
    }
  }
  void remove(long long first) {
    Node* cur = head;
    for (long long i = 30; i >= 0; i--) {
      long long b = (first >> i) & 1;
      cur = cur->nxt[b];
      cur->cnt--;
    }
  }
  long long minnxor(long long first) {
    Node* cur = head;
    long long ans = 0;
    for (long long i = 30; i >= 0; i--) {
      long long b = (first >> i) & 1;
      if (cur->nxt[b] && cur->nxt[b]->cnt > 0) {
        cur = cur->nxt[b];
        if (b) ans += (1 << i);
      } else {
        cur = cur->nxt[!b];
        if (!b) ans ^= (1LL << i);
      }
    }
    return ans;
  }
  long long maxxor(long long first) {
    Node* cur = head;
    long long ans = 0;
    for (long long i = 30; i >= 0; i--) {
      long long b = (first >> i) & 1;
      if (cur->nxt[!b] && cur->nxt[!b]->cnt > 0) {
        ans += (1LL << i);
        cur = cur->nxt[!b];
      } else
        cur = cur->nxt[b];
    }
    return ans;
  }
  long long cal(long long first, long long k) {
    long long ans = 0;
    node* cur = head;
    bool ok = 0;
    for (long long i = 30; i >= 0; i--) {
      long long curx = 0;
      long long curk = 0;
      if ((1LL << i) & first) curx = 1;
      if ((1LL << i) & k) curk = 1;
      if (curx == 0 && curk == 0 && ok == 0) {
        if (cur->nxt[0] != NULL)
          cur = cur->nxt[0];
        else
          return 0;
        continue;
      }
      ok = 1;
      if (curx == curk) {
        if (curx == 1) {
          if (cur->nxt[curx] != NULL) {
            ans += cur->nxt[curx]->cnt;
          }
          if (cur->nxt[curk ^ 1] != NULL) {
            cur = cur->nxt[curk ^ 1];
          } else {
            return ans;
          }
        } else {
          if (cur->nxt[curk] != NULL) {
            cur = cur->nxt[curk];
          } else {
            return ans;
          }
        }
      } else {
        if (curx == 0) {
          if (cur->nxt[curx] != NULL) {
            ans += cur->nxt[curx]->cnt;
          }
          if (cur->nxt[curk] != NULL)
            cur = cur->nxt[curk];
          else
            return ans;
        } else {
          if (cur->nxt[curx] != NULL) {
            cur = cur->nxt[curx];
          } else {
            return ans;
          }
        }
      }
    }
    return ans;
  }
} Trie;
void solve() {
  Trie t;
  long long n;
  cin >> n;
  long long k;
  cin >> k;
  long long xorr = 0;
  long long a[n];
  t.insert(0);
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    xorr ^= a[i];
    ans += t.cal(xorr, k);
    t.insert(xorr);
  }
  cout << (n * (n + 1)) / 2 - ans << "\n";
}
signed main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
