#include #define int long long using namespace std; signed main() { int N; cin >> N; vector masu(9, "........."); int X1, Y1, X2, Y2; bool fg1 = false; bool fg2 = false; bool fg3 = false; for( int i = 0; i < N; i++ ){ cin >> X1 >> Y1 >> X2 >> Y2; X1--; Y1--; X2--; Y2--; if( (X1 == 1 && Y1 == 7) || masu.at(X1).at(Y1) == 'A' ){ fg1 = true; masu.at(X1).at(Y1) = 'A'; masu.at(X2).at(Y2) = 'A'; }else if( (X1 == 2 && Y1 == 8) || masu.at(X1).at(Y1) == 'B' ){ fg2 = true; masu.at(X1).at(Y1) = 'B'; masu.at(X2).at(Y2) = 'B'; }else if( (X1 == 6 && Y1 == 8) || masu.at(X1).at(Y1) == 'C' ){ fg3 = true; masu.at(X1).at(Y1) = 'C'; masu.at(X2).at(Y2) = 'C'; } } if( fg1 && fg2 && fg3 && masu.at(4).at(7) == 'A' && masu.at(3).at(7) == 'B' && masu.at(5).at(7) == 'C' ){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }