#include <bits/stdc++.h>
using namespace std;
struct node {
  long long int counter;
  node* next[2];
  node() {
    counter = 0;
    next[0] = next[1] = NULL;
  }
};
void insert(node* cur_node, int n) {
  vector<int> v;
  for (int i = 0; i < 32; i++) {
    v.push_back(n % 2);
    n /= 2;
  }
  reverse(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) {
    if (cur_node->next[v[i]] == NULL) cur_node->next[v[i]] = new node();
    cur_node = cur_node->next[v[i]];
    cur_node->counter++;
  }
}
long long int search(node* cur_node, int n, int k) {
  vector<int> vn, vk;
  for (int i = 0; i < 32; i++) {
    vn.push_back(n % 2);
    vk.push_back(k % 2);
    n /= 2;
    k /= 2;
  }
  reverse(vn.begin(), vn.end());
  reverse(vk.begin(), vk.end());
  long long int res = 0;
  for (int i = 0; i < 32; i++) {
    if (vn[i] == 0) {
      if (vk[i] == 0) {
        if (cur_node->next[0] != NULL)
          cur_node = cur_node->next[0];
        else
          break;
      } else {
        if (cur_node->next[0] != NULL) res += cur_node->next[0]->counter;
        if (cur_node->next[1] != NULL)
          cur_node = cur_node->next[1];
        else
          break;
      }
    } else {
      if (vk[i] == 0) {
        if (cur_node->next[1] == NULL)
          break;
        else
          cur_node = cur_node->next[1];
      } else {
        if (cur_node->next[1] != NULL) res += cur_node->next[1]->counter;
        if (cur_node->next[0] != NULL)
          cur_node = cur_node->next[0];
        else
          break;
      }
    }
  }
  return res;
}
void solve(int t) {
  node* root = new node();
  insert(root, 0);
  long long int n, k;
  scanf("%lld%lld", &n, &k);
  vector<long long int> v;
  vector<long long int> v1;
  long long int exor = 0;
  for (int i = 0; i < n; i++) {
    long long int x;
    scanf("%lld", &x);
    exor ^= x;
    v1.push_back(x);
    v.push_back(exor);
  }
  long long int ans = 0;
  for (int i = 0; i < v.size(); i++) {
    ans += search(root, v[i], k);
    insert(root, v[i]);
  }
  long long int temp_ans = n * (n + 1);
  temp_ans /= 2;
  temp_ans -= ans;
  printf("%lld\n", temp_ans);
}
int main() { solve(1); }
