#include <bits/stdc++.h>
using namespace std;
struct node {
  int lazy, cnt, lx, rx;
  node* children[2];
  node() { children[0] = children[1] = NULL, lazy = cnt = lx = rx = 0; }
  inline void lz(int m) {
    if (lazy == 0) return;
    if (children[0] == NULL)
      lx ^= lazy;
    else
      children[0]->lazy ^= lazy;
    if (children[1] == NULL)
      rx ^= lazy;
    else
      children[1]->lazy ^= lazy;
    int s = ((lazy & (1 << m)) == 0) ? 0 : 1;
    if (s) {
      node* p = children[0];
      children[0] = children[1];
      children[1] = p;
      swap(lx, rx);
    }
    lazy = 0;
  }
  int query(int m, int k) {
    if (m == -1) return cnt;
    if (cnt == 0) return 0;
    lz(m);
    int s = ((k & (1 << m)) == 0) ? 0 : 1;
    if (s == 1) {
      return (children[1]) ? children[1]->query(m - 1, k) : 0;
    } else {
      return ((children[1]) ? children[1]->cnt : 0) +
             ((children[0]) ? children[0]->query(m - 1, k) : 0);
    }
  }
  node* insert(int m) {
    lz(m);
    cnt++;
    if (m >= 0) {
      if (children[0] == NULL) {
        children[0] = new node;
        children[0]->lazy ^= lx;
      }
      children[0] = children[0]->insert(m - 1);
    }
    return this;
  }
};
node* root;
int main() {
  root = new node;
  int n, k, x;
  scanf("%d %d", &n, &k);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    root = root->insert(30);
    root->lazy ^= x;
    ans += root->query(30, k);
  }
  printf("%lld\n", ans);
  return 0;
}
