#include using namespace std; typedef long long ll; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b #define vl vector #define vii vector> #define vll vector> #define vvi vector> #define vvl vector> #define vvii vector>> #define vvll vector>> #define vst vector #define pii pair #define pll pair #define pb push_back #define all(x) (x).begin(),(x).end() #define mkunique(x) sort(all(x));(x).erase(unique(all(x)),(x).end()) #define fi first #define se second #define mp make_pair #define si(x) int(x.size()) const int mod=998244353,MAX=300005,INF=15<<26; struct UF{ int n; vector par,size,edge; void init(int n_){ n=n_; par.assign(n,-1); size.assign(n,1); edge.assign(n,0); for(int i=0;i>N>>H>>W; int K=1005; UF uf;uf.init(K*K); vvi que(N),iru(K,vi(K,1)); vector> alive(K); for(int i=0;i>a>>b>>c>>d; b++;d++; for(int s=a;s=0;q--){ if(uf.size[uf.root(K*K-1)]==al){ ans.pb(1); }else{ ans.pb(0); } for(int u:que[q]){ al++; int h=u/K,w=u%K; for(int k=0;k<4;k++){ int toh=h+dh[k],tow=w+dw[k]; if(toh<0||toh>=K||tow<0||tow>=K) continue; if(iru[toh][tow]) uf.unite(h*K+w,toh*K+tow); } } } reverse(all(ans)); for(int a:ans){ if(a) cout<<"No\n"; else cout<<"Yes\n"; } }