#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; constexpr int INF = 2e9; int main() { int n, x; cin >> n >> x; map mp; vector a(n); rep(i,n) cin >> a[i]; for (int i = 0; i < n; i++) { mp[a[i]]++; } ll res = 0; for (int i = 0; i < n; i++) { mp[a[i]]--; res += mp[a[i] ^ x]; } cout << res << endl; return 0; }