#include <bits/stdc++.h>
using namespace std;
struct Trie {
  const static int range = 2;
  const static int maxn = 1 << 24;
  struct node {
    int next[range];
    int cnt;
  } Trienode[maxn];
  int size;
  void init() {
    memset(Trienode[0].next, 0, sizeof(Trienode[0].next));
    Trienode[0].cnt = 0;
    size = 1;
  }
  void insert(int s) {
    int now = 0;
    for (int i = 30; i >= 0; i--) {
      int c = (s >> i) & 1;
      if (!Trienode[now].next[c]) {
        memset(Trienode[size].next, 0, sizeof(Trienode[size].next));
        Trienode[size].cnt = 0;
        Trienode[now].next[c] = size++;
      }
      now = Trienode[now].next[c];
      Trienode[now].cnt++;
    }
  }
  int find(int s, int k) {
    int now = 0, i, ans = 0;
    for (i = 30; i >= 0; i--) {
      int c = (s >> i) & 1, key = (k >> i) & 1;
      if (!key && Trienode[now].next[c ^ 1])
        ans += Trienode[Trienode[now].next[c ^ 1]].cnt;
      if (Trienode[now].next[c ^ key])
        now = Trienode[now].next[c ^ key];
      else
        break;
    }
    if (i == -1) ans += Trienode[now].cnt;
    return ans;
  }
} tree;
int ss[1000010];
int main() {
  int n, k;
  long long ans = 0;
  tree.init();
  tree.insert(0);
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", ss + i);
    ss[i] ^= ss[i - 1];
    ans += tree.find(ss[i], k);
    tree.insert(ss[i]);
  }
  printf("%I64d\n", ans);
}
