#include <bits/stdc++.h>   using namespace std;   const double eps = 1e-9;   const int inf = 2000000000;   const long long infLL = 9000000000000000000;   template <typename first, typename second>   ostream& operator<<(ostream& os, const pair<first, second>& p) {     return os <<  (  << p.first <<  ,   << p.second <<  ) ;   }   template <typename T>   ostream& operator<<(ostream& os, const vector<T>& v) {     os <<  { ;     for (auto it = v.begin(); it != v.end(); ++it) {       if (it != v.begin()) os <<  ,  ;       os << *it;     }     return os <<  } ;   }   template <typename T>   ostream& operator<<(ostream& os, const set<T>& v) {     os <<  [ ;     for (auto it = v.begin(); it != v.end(); ++it) {       if (it != v.begin()) os <<  , ;       os << *it;     }     return os <<  ] ;   }   template <typename T>   ostream& operator<<(ostream& os, const multiset<T>& v) {     os <<  [ ;     for (auto it = v.begin(); it != v.end(); ++it) {       if (it != v.begin()) os <<  ,  ;       os << *it;     }     return os <<  ] ;   }   template <typename first, typename second>   ostream& operator<<(ostream& os, const map<first, second>& v) {     os <<  [ ;     for (auto it = v.begin(); it != v.end(); ++it) {       if (it != v.begin()) os <<  ,  ;       os << it->first <<   =   << it->second;     }     return os <<  ] ;   }   void faltu() { cerr <<   n ; }   template <typename T>   void faltu(T a[], int n) {     for (int i = 0; i < n; ++i) cerr << a[i] <<    ;     cerr <<   n ;   }   template <typename T, typename... hello>   void faltu(T arg, const hello&... rest) {     cerr << arg <<    ;     faltu(rest...);   }   inline bool checkBit(long long n, int i) { return n & (1LL << i); }   inline long long setBit(long long n, int i) {     return n | (1LL << i);     ;   }   inline long long resetBit(long long n, int i) { return n & (~(1LL << i)); }   const int mx = 1e6 + 5;   int n, k;   int a[mx];   struct Vertex {     Vertex() {}     int zero = -1, one = -1;     int dp_zero = 0, dp_one = 0;   };   vector<Vertex> trie;   void add(int num, int node, int pos) {     if (pos == -1) {       ++trie[node].dp_one;       return;     }     if (checkBit(num, pos)) {       if (trie[node].one == -1) {         trie[node].one = (int)trie.size();         int node_child = (int)trie.size();         trie.push_back(Vertex());         add(num, node_child, pos - 1);       } else {         int node_child = trie[node].one;         add(num, node_child, pos - 1);       }       ++trie[node].dp_one;     } else {       if (trie[node].zero == -1) {         trie[node].zero = (int)trie.size();         int node_child = (int)trie.size();         trie.push_back(Vertex());         add(num, node_child, pos - 1);       } else {         int node_child = trie[node].zero;         add(num, node_child, pos - 1);       }       ++trie[node].dp_zero;     }   }   long long ans = 0;   int amount;   void dfs(int num, int node, int pos) {     if (pos == -1) {       ans += trie[node].dp_one;       return;     }     if (checkBit(k, pos)) {       if (checkBit(num, pos)) {         if (trie[node].zero != -1) {           int node_child = trie[node].zero;           if (pos == 0) amount = trie[node].dp_zero;           dfs(num, node_child, pos - 1);         }       } else {         if (trie[node].one != -1) {           int node_child = trie[node].one;           if (pos == 0) amount = trie[node].dp_one;           dfs(num, node_child, pos - 1);         }       }     } else {       if (checkBit(num, pos)) {         ans += trie[node].dp_zero;         int node_child = trie[node].one;         if (pos == 0) amount = trie[node].dp_one;         if (node_child != -1) dfs(num, node_child, pos - 1);       } else {         ans += trie[node].dp_one;         int node_child = trie[node].zero;         if (pos == 0) amount = trie[node].dp_zero;         if (node_child != -1) dfs(num, node_child, pos - 1);       }     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     cin >> n >> k;     trie.push_back(Vertex());     add(0, 0, 30);     for (int i = 1; i <= n; ++i) cin >> a[i];     long long Xor = 0;     for (int i = 1; i <= n; ++i) {       Xor ^= a[i];       dfs(Xor, 0, 30);       add(Xor, 0, 30);     }     cout << ans <<   n ;   }