#line 2 "/home/chabudaisanta/lib/gwen/src/gwen/my_template.hpp" #ifdef LOCAL #define _GLIBCXX_DEBUG #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #line 2 "/home/chabudaisanta/lib/gwen/src/gwen/dump.hpp" #line 17 "/home/chabudaisanta/lib/gwen/src/gwen/dump.hpp" #line 2 "/home/chabudaisanta/lib/gwen/src/gwen/types.hpp" #include namespace gwen { using i32 = int32_t; using i64 = int64_t; using i128 = __int128_t; using u32 = uint32_t; using u64 = uint64_t; using u128 = __uint128_t; } // namespace gwen #line 19 "/home/chabudaisanta/lib/gwen/src/gwen/dump.hpp" namespace gwen { //------------------------- // standard types //------------------------- constexpr inline std::string to_str() { return ""; } constexpr inline std::string to_str(bool b) { return b ? "true" : "false"; } constexpr inline std::string to_str(char c) { return std::string{c}; } constexpr inline std::string to_str(const char* cs) { return std::string{cs}; } constexpr inline std::string to_str(const std::string& str) { return str; } constexpr inline std::string to_str(std::nullptr_t) { return "nullptr"; } constexpr inline std::string to_str(u128 x) { if (x == 0) return "0"; std::string ret; while (x) { ret.push_back(static_cast('0' + (x % 10))); x /= 10; } std::reverse(ret.begin(), ret.end()); return ret; } constexpr inline std::string to_str(i128 x) { if (x < 0) return std::string{'-'} + to_str(static_cast(-x)); return to_str(static_cast(x)); } template std::string to_str(T x) { return std::to_string(x); } template std::string to_str(T f) { return std::to_string(f); } //------------------------- // prototype //------------------------- // pair / tuple template std::string to_str(const std::pair& p); template std::string to_str(const std::tuple& t); // input iterator helper template std::string to_str(Iterator begin, Iterator end, const std::string& partition = ", ", char pb = '\0', char pe = '\0'); // sequence containers template std::string to_str(const std::vector& sc); template std::string to_str(const std::array& sc); template std::string to_str(const std::deque& sc); template std::string to_str(const T (&sc)[N]); // set containers template std::string to_str(const std::set& se); template std::string to_str(const std::multiset& se); template std::string to_str(const std::unordered_set& se); template std::string to_str(const std::unordered_multiset& se); // map containers template std::string to_str(const std::map& mp); template std::string to_str(const std::multimap& mp); template std::string to_str(const std::unordered_map& mp); template std::string to_str(const std::unordered_multimap& mp); template std::string to_str_map_helper(Iterator begin, Iterator end); // user-defined template requires requires(const T& t) { gwen::to_str(t.val()); } std::string to_str(const T& t); template requires requires(const T& t) { gwen::to_str(t.dump()); } std::string to_str(const T& t); //------------------------- // implementation //------------------------- // pair / tuple template std::string to_str(const std::pair& p) { return std::string{'('} + to_str(p.first) + ", " + to_str(p.second) + ')'; } template std::string to_str(const std::tuple& t) { std::string ret{'('}; bool first = true; std::apply( [&](const auto&... args) { ((ret += (first ? "" : ", "), ret += gwen::to_str(args), first = false), ...); }, t); return ret + ')'; } template inline std::string to_str_variadic(const Args&... args) { std::string ret; std::size_t index = 0; auto process_one = [&](const auto& arg) { if (index++ > 0) { ret += ", "; } if constexpr (requires { gwen::to_str(arg); }) { ret += gwen::to_str(arg); } else { ret += "[?]"; } }; (process_one(args), ...); return ret; } // input iterator helper template std::string to_str(Iterator begin, Iterator end, const std::string& partition, char pb, char pe) { std::string ret; if (pb) ret += pb; for (auto it = begin; it != end; ++it) { if (it != begin) ret += partition; ret += to_str(*it); } if (pe) ret += pe; return ret; } // sequence containers template std::string to_str(const std::vector& sc) { return to_str(sc.begin(), sc.end(), ", ", '[', ']'); } template std::string to_str(const std::array& sc) { return to_str(sc.begin(), sc.end(), ", ", '[', ']'); } template std::string to_str(const std::deque& sc) { return to_str(sc.begin(), sc.end(), ", ", '[', ']'); } template std::string to_str(const T (&sc)[N]) { return to_str(sc.begin(), sc.end(), ", ", '[', ']'); } // set containers template std::string to_str(const std::set& se) { return to_str(se.begin(), se.end(), ", ", '{', '}'); } template std::string to_str(const std::multiset& se) { return to_str(se.begin(), se.end(), ", ", '{', '}'); } template std::string to_str(const std::unordered_set& se) { return to_str(se.begin(), se.end(), ", ", '{', '}'); } template std::string to_str(const std::unordered_multiset& se) { return to_str(se.begin(), se.end(), ", ", '{', '}'); } // map containers template std::string to_str(const std::map& mp) { return to_str_map_helper(mp.begin(), mp.end()); } template std::string to_str(const std::multimap& mp) { return to_str_map_helper(mp.begin(), mp.end()); } template std::string to_str(const std::unordered_map& mp) { return to_str_map_helper(mp.begin(), mp.end()); } template std::string to_str(const std::unordered_multimap& mp) { return to_str_map_helper(mp.begin(), mp.end()); } template std::string to_str_map_helper(Iterator begin, Iterator end) { std::string ret{'{'}; for (auto it = begin; it != end; ++it) { if (it != begin) ret += ", "; ret += '(' + to_str(it->first) + ": " + to_str(it->second) + ')'; } ret += '}'; return ret; } // user-defined template requires requires(const T& t) { gwen::to_str(t.val()); } std::string to_str(const T& t) { return gwen::to_str(t.val()); } template requires requires(const T& t) { gwen::to_str(t.dump()); } std::string to_str(const T& t) { return gwen::to_str(t.dump()); } } // namespace gwen #ifdef LOCAL #define DEBUG(...) \ std::cerr << #__VA_ARGS__ << ": " << gwen::to_str_variadic(__VA_ARGS__) \ << '\n' #define DUMP(...) \ std::cerr << #__VA_ARGS__ << ": " << gwen::to_str_variadic(__VA_ARGS__) \ << '\n' #else #define DEBUG(...) void(0) #define DUMP(...) void(0) #endif // std::string += std::string は、atcoder環境なら線形時間でやってくれそう // https://atcoder.jp/contests/abc379/submissions/69207872 #line 37 "/home/chabudaisanta/lib/gwen/src/gwen/my_template.hpp" using gwen::i128; using gwen::i32; using gwen::i64; using gwen::u128; using gwen::u32; using gwen::u64; using ll = long long; using ull = unsigned long long; #define rep(i, l, r) for (int i = (int)(l); i < (int)(r); ++i) #define rp(i, n) for (int i = 0; i < (int)(n); ++i) #define rrep(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); --i) #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #ifdef LOCAL #define BAR std::cerr << "----------------------------------------------\n" #define S_BAR std::cerr << "------------------\n" #else #define BAR void(0) #define S_BAR void(0) #endif constexpr std::pair mv[] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}, {1, 1}, {1, -1}, {-1, -1}, {-1, 1}, {0, 0}}; constexpr int dw[] = {0, 0, -1, 1, -1, -1, 1, 1, 0}; constexpr int dh[] = {-1, 1, 0, 0, -1, 1, -1, 1, 0}; constexpr int mod998 = 998244353, mod107 = 1000000007, mod109 = 1000000009, mod31 = 2147483647; constexpr ll mod61 = (1LL << 61) - 1; constexpr int iINF = (1 << 30) + 1; constexpr ll liINF = (1LL << 60) + 1; constexpr char EL = '\n', SPA = ' '; std::pair mv_to(int hi, int wi, int dir) { assert(0 <= dir && dir < 9); return std::make_pair(hi + dh[dir], wi + dw[dir]); } template inline bool chmax(T1& a, T2 b) { return (a < b ? a = b, true : false); } template inline bool chmin(T1& a, T2 b) { return (a > b ? a = b, true : false); } template inline bool isIn(T x, T l, T r) { return (l <= x) && (x < r); } template inline bool isOut(T x, T l, T r) { return (x < l) || (r <= x); } template std::ostream& operator<<(std::ostream& os, const std::vector& vec) { for (auto it = vec.begin(); it != vec.end(); it++) os << *it << (it == prev(vec.end()) ? "" : " "); return os; } template std::istream& operator>>(std::istream& is, std::vector& vec) { for (T& e : vec) is >> e; return is; } void yon(bool b) { std::cout << (b ? "Yes\n" : "No\n"); } template std::vector idxsort(const std::vector& vec, bool rev = false) { std::vector ret(vec.size()); std::iota(ret.begin(), ret.end(), 0); sort(ret.begin(), ret.end(), [&vec, &rev](int a, int b) { return (rev ? vec[a] > vec[b] : vec[a] < vec[b]); }); return ret; } template T ceil_div(T x, T y) { assert(y != 0); T d = x / y; return d * y == x ? d : d + ((x > 0) ^ (y < 0)); } template T floor_div(T x, T y) { assert(y != 0); T d = x / y; return d * y == x ? d : d - ((x < 0) ^ (y < 0)); } template T out_div(T x, T y) { assert(y != 0); T d = x / y; return d * y == x ? d : ((x > 0) == (y > 0)) ? d + 1 : d - 1; } // https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3605r0.pdf template constexpr T isqrt(const T n) noexcept { if (n <= T{1}) return n; T i_current{0}, i_next{T(T{1} << ((std::bit_width(T(n - 1)) + 1) >> 1))}; do { i_current = i_next; i_next = T((i_current + n / i_current) >> 1); } while (i_next < i_current); return i_current; } template constexpr T sq(T x) { return x * x; } template constexpr T choose2(T x) { return x * (x - 1) / 2; } template constexpr T1 getBit(T1 bit, T2 i) { return bit & (static_cast(1) << i); } template constexpr T1 setBit(T1 bit, T2 i) { return bit | (static_cast(1) << i); } template constexpr T1 clearBit(T1 bit, T2 i) { return bit & ~(static_cast(1) << i); } template constexpr T1 toggleBit(T1 bit, T2 i) { return bit ^ (static_cast(1) << i); } template auto runlength(Iterator begin, Iterator end) { using ValueType = typename std::iterator_traits::value_type; using CountType = int; std::vector> ret; for (auto it = begin; it != end; ++it) { if (ret.empty() || ret.back().first != *it) ret.emplace_back(*it, 0); ret.back().second++; } return ret; } #if __has_include() #include using mint998 = atcoder::modint998244353; using mint107 = atcoder::modint1000000007; #endif #if __has_include() #include using gmp_int = mpz_class; #endif /* #if __has_include() #include #endif */ #line 2 "a.cpp" using namespace std; void solve() { i32 N, L, R; cin >> N >> R; L = 1; vector A(N); cin >> A; u32 grundy = 0; rp(i,N) { u32 r = A[i] % (L + R); u32 x = r / L; grundy ^= x; } cout << (grundy ? "YES" : "NO") << EL; } int main(void) { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); std::cout << std::fixed << std::setprecision(16); int t = 1; //cin >> t; while (t--) solve(); std::cerr << "execution time: " << 1.0 * clock() / CLOCKS_PER_SEC * 1000 << "(ms)" << EL; return 0; }