#include #define rep(i, p, n) for (ll i = p; i < (ll)(n); i++) #define rep2(i, p, n) for(ll i = p; i >= (ll)(n); i-- ) using namespace std; using ll = long long; using ld = long double; double pi=3.141592653589793; const long long inf=2*1e9; const long long linf=8*1e18; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //atcoder #include #include #include #include using namespace atcoder; using mint1 = modint1000000007; using mint2 = modint998244353; /* //多倍長整数 #include using namespace boost::multiprecision; using ci = cpp_int; //ciで定義 //https://boostjp.github.io/tips/multiprec-int.html //常時使っているとdouble >> llの適切なキャストができない(ll sqrt(整数)等)ので、基本はコメントアウト */ //拡張ユークリッド //input: ll a,b //output: ax+by=gcd(a,b)の解(x,y)( extgcd(long long a, long long b) { if (b == 0) return make_pair(1, 0); long long x, y; tie(y, x) = extgcd(b, a % b); y -= a / b * x; return make_pair(x, y); } //素数列挙 //output: (void)N以下の整数のうち素数であるものをsosuuに返す void SR(ll N, vector &sosuu) { vector testSR(N+1, true); for(int i=2; i<=N; i++) { if (testSR.at(i)) { sosuu.push_back(i); for(int j=i*2; j<=N; j+=i) { testSR.at(j)=false; } } } } int main() { //////////////////// cin.tie(nullptr); ios_base::sync_with_stdio(false); //////////////////// ll N, K; cin >> N >> K; vector A(N+1), B(N); rep(i, 0, N) { cin >> A.at(i+1); B.at(i)=A.at(i+1); } bool ch=false; ll temp=-1; map M; M[0]=true; rep(i, 0, N) { A.at(i+1)=A.at(i+1)^A.at(i); if (M[A.at(i+1)]) { if (!ch) { ch=true; temp=B.at(i); } else { cout << "No"; return 0; } } M[A.at(i+1)]=true; } if (!ch) { cout << "Yes"; return 0; } ll L=max(temp-K, ll(1)), R=temp+K; rep(i, L, R+1) { if (!M[i]) { cout << "Yes"; return 0; } } cout << "No"; }