# CF 869E(The Untended Antiquity-Hash值维护连通性)

1.一个矩阵四周加上障碍 （不与任何障碍相交）
2.一个矩阵四周的障碍消除
3.问你两个点之间是否纯在一条路径不经过障碍

#include<bits/stdc++.h>
using namespace std;
#define For(i,n) for(int i=1;i<=n;i++)
#define Fork(i,k,n) for(int i=k;i<=n;i++)
#define ForkD(i,k,n) for(int i=n;i>=k;i--)
#define Rep(i,n) for(int i=0;i<n;i++)
#define ForD(i,n) for(int i=n;i;i--)
#define RepD(i,n) for(int i=n;i>=0;i--)
#define Forp(x) for(int p=pre[x];p;p=next[p])
#define Forpiter(x) for(int &p=iter[x];p;p=next[p])
#define Lson (o<<1)
#define Rson ((o<<1)+1)
#define MEM(a) memset(a,0,sizeof(a));
#define MEMI(a) memset(a,0x3f,sizeof(a));
#define MEMi(a) memset(a,128,sizeof(a));
#define MEMx(a,b) memset(a,b,sizeof(a));
#define INF (0x3f3f3f3f)
#define F (1000000007)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int,int>
#define SI(a) ((a).size())
#define Pr(kcase,ans) printf("Case #%d: %lld\n",kcase,ans);
#define PRi(a,n) For(i,n-1) cout<<a[i]<<' '; cout<<a[n]<<endl;
#define PRi2D(a,n,m) For(i,n) { \
For(j,m-1) cout<<a[i][j]<<' ';\
cout<<a[i][m]<<endl; \
}
#define ALL(x) (x).begin(),(x).end()
#define gmax(a,b) a=max(a,b);
#define gmin(a,b) a=min(a,b);
typedef unsigned long long ll;
typedef long double ld;
typedef unsigned long long ull;
ll mul(ll a,ll b){return (a*b)%F;}
ll sub(ll a,ll b){return ((a-b)%F+F)%F;}
void upd(ll &a,ll b){a=(a%F+b%F)%F;}
{
int x=0,f=1; char ch=getchar();
while(!isdigit(ch)) {if (ch=='-') f=-1; ch=getchar();}
while(isdigit(ch)) { x=x*10+ch-'0'; ch=getchar();}
return x*f;
}
int n,m;
#define MAXN (2510+10)
ll f[MAXN][MAXN]={0};
void add(int x,int y,ll v) {
for(int i=x;i<=n;i+=i&(-i))
for(int j=y;j<=m;j+=j&(-j))
f[i][j]^=v;
}
ll qur(int x,int y) {
ll v=0;
for(int i=x;i;i-=i&(-i))
for(int j=y;j;j-=j&(-j))
v^=f[i][j];
return v;
}
map < pair<pi, pi > ,ll > h;
ll rand(int r1,int c1,int r2,int c2) {
if (h.find(mp(mp(r1,c1),mp(r2,c2)))!=h.end())
return h[mp(mp(r1,c1),mp(r2,c2))];
ll rn=rand();
rn= (rn<<16ULL)| rand();
srand(rn);
h[mp(mp(r1,c1),mp(r2,c2)) ]=rn;
return rn;
}
int q;
int main()
{
//  freopen("E.in","r",stdin);
//  freopen(".out","w",stdout);
srand(123);
n+=3,m+=3;
For(i,q) {
ll p=rand(r1,c1,r2,c2);
if (t<=2) {
}
else {
ll ans1=qur(r2,c2);
ll ans2=qur(r1,c1);
if (ans1==ans2) {
puts("Yes");
}else puts("No");

}
}

return 0;
}