#include #include #define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) using namespace std; using namespace atcoder; typedef long long ll; int f(vector a) { int n = a.size(); unordered_map ma; int x = 0; ma[0]++; rep(i, 0, n) { x ^= a[i]; ma[x]++; } x = 0; int ct = 0; rep(i, 0, n) { ma[x]--; ct += ma[x]; x ^= a[i]; } return ct; } int main() { int n, k; cin >> n >> k; vector a(n); rep(i, 0, n) cin >> a[i]; if (f(a) == 0) { cout << "Yes" << endl; return 0; } rep(i, 0, n) { a[i]++; if (f(a) == 0) { cout << "Yes" << endl; return 0; } a[i]--; } while (clock() < 6000000) { int ind = rand() % n; int ad = rand() % k + 1; if (rand() % 2) ad *= -1; a[ind] += ad; if (a[ind] > 0 && f(a) == 0) { cout << "Yes" << endl; return 0; } a[ind] -= ad; } cout << "No" << endl; }