#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X)) #define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X)) #define all(X) (X).begin(),(X).end() #define pb push_back #define mk make_pair #define fi first #define sc second using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const int MAX_N = 1e6, MAX_A = 1e6; int n, k; int a[MAX_N]; int grendy[MAX_A+1]; int main() { cin >> n >> k; rep(i,n) cin >> a[i]; grendy[0] = 0; int max_a = *max_element(a, a+n); for (int j = 1; j <= max_a; ++j) { set s; for (int i = 1; i <= k; ++i) { if (i <= j) s.insert(grendy[j - i]); } int g = 0; while (s.count(g) != 0) ++g; grendy[j] = g; } int win = 0; for (int i = 0; i < n; ++i) win ^= grendy[a[i]]; if (win != 0) puts("YES"); else puts("NO"); return 0; }