#include #define rep(i,n) for (int i=0; i<(n); ++i) using namespace std; using ll=long long; int main(){ int n; cin>>n; vectorx1(n),x2(n),y1(n),y2(n); paira=make_pair(2,8), b=make_pair(3,9), c=make_pair(6,8); rep(i,n){ cin>>x1[i]>>y1[i]>>x2[i]>>y2[i]; if(a.first==x1[i]&&a.second==y1[i]) a=make_pair(x2[i],y2[i]); if(b.first==x1[i]&&b.second==y1[i]) b=make_pair(x2[i],y2[i]); if(c.first==x1[i]&&c.second==y1[i]) c=make_pair(x2[i],y2[i]); } if(a.first==5&&a.second==8&& b.first==4&&b.second==8&& c.first==6&&c.second==8) cout<<"YES"<