//Normal #define _GLIBCXX_DEBUG #define ll long long #include using namespace std; using Graph = vector>; void print(auto a){ cout << a; } void prints(auto a){ cout << a << " "; } void prints(){ cout << " "; } void printl(auto a){ cout << a << endl; } void printl(){ cout << endl; } void fix(int n){ cout << fixed << setprecision(n); } int main(){ int N; cin >> N; vector> X(10, vector(10, '-')); X[2][8] = 'A'; X[3][9] = 'B'; X[7][9] = 'C'; for(int i = 0; i < N; i++){ int X1, Y1, X2, Y2; cin >> X1 >> Y1 >> X2 >> Y2; swap(X[X1][Y1], X[X2][Y2]); } X[5][8] == 'A' and X[4][8] == 'B' and X[6][8] == 'C' ? printl("YES") : printl("NO"); return 0; }