ll@n,@m;unionFind u('m',2n+1,1);rep(m){ll@a,@b;if(u(a,b+n)-u(a+n,b))wt("No"),exit(0);}wt("Yes");