#include using namespace std; using ll = long long int; using lc = complex; int main(void) { constexpr ll MOD = 1e9 + 7; constexpr double PI = acos(-1); cout << fixed << setprecision(32); cin.tie(0); ios::sync_with_stdio(false); ll n, x; cin >> n >> x; map m; while(n--) { ll a; cin >> a; m[a]++; } ll r = 0; for(auto &[y, c]: m) { ll z = x ^ y; if(z > y) continue; r += (z == y ? (c-1)*m[z]/2 : c * m[z]); } cout << r<< endl; }