#include using namespace std; using ll = long long; #define rep(i, s, t) for (int i = (int)(s); i < (int)(t); ++i) #define revrep(i, t, s) for (int i = (int)(t)-1; i >= (int)(s); --i) #define all(x) begin(x), end(x) template bool chmax(T& a, const T& b) { return a < b ? (a = b, 1) : 0; } template bool chmin(T& a, const T& b) { return a > b ? (a = b, 1) : 0; } template ostream& operator<<(ostream& os, const vector& v) { for (int i = 0; i < (int)v.size(); ++i) { os << v[i]; if (i < (int)v.size() - 1) os << " "; } return os; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); int N, K; cin >> N >> K; vector A(N); for (auto& x : A) cin >> x; vector B(N + 1); rep(i, 0, N) B[i + 1] = B[i] ^ A[i]; map prv; int left = 0; int right = N; bool f = false; rep(i, 0, N + 1) { if (prv.contains(B[i])) { if (prv[B[i]] == -1) { cout << "No" << endl; return 0; } chmax(left, prv[B[i]]); chmin(right, i); prv[B[i]] = -1; f = true; } else { prv[B[i]] = i; } } if (left >= right) { cout << "No" << endl; return 0; } if (!f) { cout << "Yes" << endl; } set cand; rep(i, left, right) { rep(x, max(1, A[i] - K), A[i] + K + 1) cand.insert(x ^ A[i]); } vector first(1 << 20, -1); rep(i, 0, N + 1) { if (first[B[i]] == -1) { first[B[i]] = i; } } for (int x : cand) { vector banned(N + 1); rep(i, 0, N + 1) { if (first[B[i] ^ x] != -1) { int l = first[B[i] ^ x]; if (l < i) { ++banned[l]; --banned[i]; } } } rep(i, 0, N) banned[i + 1] += banned[i]; rep(i, left, right) { if (!banned[i] && abs((A[i] ^ x) - A[i]) <= K) { cout << "Yes" << endl; return 0; } } } cout << "No" << endl; }