#include <bits/stdc++.h>
int cnt[1 << 24];
int jd[1 << 24][2];
int n, k;
long long ans = 0;
int p = 0;
void add(int x) {
  int z = 0;
  for (int i = 30; i >= 0; i--) {
    int c = (x >> i) & 1;
    if (jd[z][c] == 0) {
      jd[z][c] = ++p;
    }
    z = jd[z][c];
    cnt[z]++;
  }
}
void find(int x) {
  int z = 0;
  for (int i = 30; i >= 0; i--) {
    int c = (x >> i) & 1;
    int d = (k >> i) & 1;
    if (d == 0) ans = ans + cnt[jd[z][(c + 1) % 2]];
    if (jd[z][c ^ d] != 0)
      z = jd[z][c ^ d];
    else
      return;
  }
  ans = ans + cnt[z];
}
int main() {
  scanf("%d %d", &n, &k);
  add(0);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    int temp;
    scanf("%d", &temp);
    sum = sum ^ temp;
    find(sum);
    add(sum);
  }
  printf("%lld\n", ans);
}
