#include #include #include #include using namespace std; #include using ull = unsigned long long; using S = ull; S op(S l, S) { return l; } S e() { return 0; } using F = pair; // to0, to1 S mapping(F f, S x) { return (~x & f.first) | (x & f.second); } F composition(F f, F g) { auto [f0, f1] = f; auto [g0, g1] = g; return {(g0 & f1) | (~g0 & f0), (g1 & f1) | (~g1 & f0)}; } ull gen(int d) { ull ret = 0; for (int x = 0; x < 64; ++x) { if ((x >> d) & 1) ret |= ull(1) << x; } return ret; } constexpr ull all = ull(-1); F id() { return {0, all}; } int main() { cin.tie(nullptr)->sync_with_stdio(false); int N, Q; cin >> N >> Q; vector init(N); { vector P(6); for (int i = 0; i < 6; ++i) P.at(i) = gen(i); for (int i = 0; i < N; ++i) init.at(i) = P.at(i % 6); } atcoder::lazy_segtree seg(init); unordered_set us; while (Q--) { int h; string o; int l, r; cin >> h >> o >> l >> r; const S y = seg.get(h); F f; if (o == "land") { f = {0, y}; } else if (o == "lor") { f = {y, all}; } else if (o == "Rightarrow") { f = {all, y}; } else { assert(false); } seg.apply(l, r + 1, f); cin >> l >> r; bool ok = false; us.clear(); for (int i = l; i <= r; ++i) { const S x = seg.get(i); if (us.count(x)) { ok = true; break; } us.insert(x); } cout << (ok ? "Yes" : "No") << "\n"; } }