#line 2 "library/src/template.hpp" #include #define rep(i, N) for (int i = 0; i < (N); i++) #define all(x) (x).begin(),(x).end() #define popcount(x) __builtin_popcount(x) using i128=__int128_t; using ll = long long; using ld = long double; using graph = std::vector>; using P = std::pair; constexpr int inf = 1e9; constexpr ll infl = 1e18; constexpr ld eps = 1e-6; const long double pi = acos(-1); constexpr uint64_t MOD = 1e9 + 7; constexpr uint64_t MOD2 = 998244353; constexpr int dx[] = { 1,0,-1,0 }; constexpr int dy[] = { 0,1,0,-1 }; templateconstexpr inline void chmax(T&x,T y){if(xconstexpr inline void chmin(T&x,T y){if(x>y)x=y;} #line 2 "main.cpp" using namespace std; #pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") int grundy[(int)1e6 + 1]; int cnt[(int)1e6 + 2]; int main() { int n, k; scanf("%d%d", &n, &k); for (int i = 1; i <= (int)1e6; ++i) { if (i - k - 1 >= 0) { --cnt[grundy[i - k - 1]]; } if (i) ++cnt[grundy[i - 1]]; int mex = -1; while (cnt[++mex]); grundy[i] = mex; } int XOR_SUM = 0; rep(i, n) { int a; scanf("%d", &a); XOR_SUM ^= grundy[a]; } puts(XOR_SUM ? "YES" : "NO"); }