#include #include #include #include #include #include using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(int)(n); i++) const i64 INF = 1001001001001001001; using modint = atcoder::static_modint<998244353>; const int t1 = 525118 ^ 36251; const int t2 = 575820 ^ 36251; bool solve(vector A, u32 X){ sort(A.begin(), A.end()); int N = A.size(); vector A2[2]; rep(i,N){ if(A[i] < (A[i]^X)) A2[0].push_back(A[i]); else A2[1].push_back(A[i]); } bool ans = false; rep(t,2){ vector A3; rep(i,N) rep(d,2) if(i < (int)A2[d].size()) A3.push_back(A2[d][i]); bool ok = true; rep(i,N-1) if(A3[i] >= (A3[i+1]^X) || (A3[i]^X) >= A3[i+1]) ok = false; ans = ans || ok; swap(A2[0], A2[1]); } return ans; } int main(){ int N; cin >> N; u32 X; cin >> X; vector A(N); rep(i,N) cin >> A[i]; sort(A.begin(), A.end()); u32 D = 1; while(D < X){ D *= 2; } D--; bool ans = true; while(A.size()){ vector tmp = {A.back()}; A.pop_back(); while(A.size()){ u32 a = A.back(); if((a&~D) != (tmp.back()&~D)) break; tmp.push_back(a); A.pop_back(); } ans = ans && solve(move(tmp), X); } cout << (ans ? "Yes\n" : "No\n"); return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } } ios_do_not_sync_instance;