#include #include using namespace std; using ll = long long; struct IoSetup { IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); } } iosetup; static bool is_power_of_two(const ll x) { return x > 0 && (x & (x - 1)) == 0; } struct S { ll sum, mx, pos, odd; bool ok; constexpr S() : sum(0), mx(0), pos(0), odd(0), ok(true) { } S(ll x) { const auto w = x & -x; sum = w; mx = w; pos = 0; odd = x / w; ok = true; } [[nodiscard]] bool can_merge() const { return odd > 0 && ok && pos % mx == 0 && is_power_of_two(sum); } }; static constexpr S op(const S& a, const S &b) { if (a.sum == 0) return b; if (b.sum == 0) return a; S c; c.sum = a.sum + b.sum; c.odd = a.odd == b.odd ? a.odd : -1; const auto d = a.sum + b.pos - a.pos; c.ok = a.ok && b.ok && d % min(a.mx, b.mx) == 0; if (a.mx >= b.mx) { c.mx = a.mx; c.pos = a.pos; } else { c.mx = b.mx; c.pos = a.sum + b.pos; } return c; } static constexpr S e() { return {}; } int main() { int N, Q; cin >> N >> Q; vector init; init.reserve(N); for (int i = 0; i < N; i++) { int x; cin >> x; init.emplace_back(x); } atcoder::segtree seg(init); while (Q--) { int t; cin >> t; if (t == 1) { int k, x; cin >> k >> x; seg.set(k - 1, x); } else { int l, r; cin >> l >> r; if (seg.prod(l - 1, r).can_merge()) cout << "Yes\n"; else cout << "No\n"; } } }