#include<bits/stdc++.h>
using namespace std;

template<typename X, typename Y>
bool chmax(X& a, Y b) { return (a < b) ? a = b, 1 : 0; }

template<typename X, typename Y>
bool chmin(X& a, Y b) { return (a > b) ? a = b, 1 : 0; }

using ll = long long;

const int N = 3e7+5; // 30 * N

int n, k;

int trie[N][2], cnt[N], nodes = 1;

void insert(int x) {
    int u = 1;
    for (int i = 29; i >= 0; i--) {
        int b = (x >> i) & 1;
        if (!trie[u][b]) trie[u][b] = ++nodes;
        u = trie[u][b];
        cnt[u]++;
    }
}

ll query(int p, int k) {
    int u = 1;
    ll res = 0;
    for (int i = 29; i >= 0; i--) {
        if (!u) break;
        int b_p = (p >> i) & 1, b_k = (k >> i) & 1;
        if (b_k == 1) u = trie[u][b_p ^ 1];
        else {
            if (trie[u][b_p ^ 1]) res += cnt[trie[u][b_p ^ 1]];
            u = trie[u][b_p];
        }
    }
    if (u) res += cnt[u];
    return res;
}

void solve() {
    cin >> n >> k;
    insert(0); // P_0 = 0
    ll ans = 0;
    int sum = 0;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        sum ^= x;
        ans += query(sum, k);
        insert(sum);
    }
    cout << ans << '\n';
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    #define TASK "BAI4"
    if (fopen(TASK".INP", "r")) {
        freopen(TASK".INP", "r", stdin);
        freopen(TASK".OUT", "w", stdout);
    }

    int tests = 1; // cin >> tests;
    while (tests--) solve();

    #ifdef LOCAL
    cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}