#include #include using ll = long long; using ull = unsigned long long; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define REP(i, m, n) for(int i = (int)(m); i < (int)(n); i++) using namespace std; using namespace atcoder; using mint = modint998244353; const int inf = 1000000007; const ll longinf = 1ll << 60; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; vector a(n); rep(i, n) cin >> a[i]; vector s(n + 1); rep(i, n) s[i + 1] = s[i] ^ a[i]; int m = 1 << 20; vector l(m, -1), r(m, -1); int left = -1, right = n + 1; rep(i, n + 1) { if(r[s[i]] != -1) { left = max(left, r[s[i]]); right = min(right, i); } r[s[i]] = i; if(l[s[i]] == -1) { l[s[i]] = i; } } if(left >= right) { cout << "No" << endl; return 0; } if(left == -1) { cout << "Yes" << endl; return 0; } vector ng(n + 1, vector(128, vector(14, short(0)))); rep(i, n + 1) { rep(j, 128) { rep(k, 14) { int v = j | ((1 << k) - 1) << 7; int li = l[s[i] ^ v], ri = r[s[i] ^ v]; if(li != -1 && li < i) { ng[li][j][k]++; ng[i][j][k]--; } if(ri != -1 && i < ri) { ng[i][j][k]++; ng[ri][j][k]--; } } } } rep(i, n) rep(j, 128) rep(k, 14) ng[i + 1][j][k] += ng[i][j][k]; bool can = false; REP(i, left, right) { for(int j = max(1, a[i] - k); j <= a[i] + k; j++) { int v = j ^ a[i]; int c = 0; while(v >> (7 + c) & 1) { v ^= 1 << (7 + c); ++c; } if(!ng[i][v][c]) { can = true; break; } } } cout << (can ? "Yes" : "No") << endl; return 0; }