#include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define ld long double #define INF 1000000000000000000 typedef pair pll; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N, X; cin >> N >> X; vector A(N); rep(i, N) { cin >> A[i]; } multiset mul; ll ans = 0; for (int i = N - 1; i > 0; i--) { mul.insert(A[i]); ll tar = A[i - 1] ^ X; ans += mul.count(tar); } cout << ans << endl; }