#include #include using namespace std; int main(){ vector> c(9, vector(9, '.')); c[1][7] = 'A'; c[2][8] = 'B'; c[6][8] = 'C'; int N; cin >> N; for (int i = 0; i < N; i++){ int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; x1--; y1--; x2--; y2--; swap(c[x1][y1], c[x2][y2]); } if (c[4][7] == 'A' && c[3][7] == 'B' && c[5][7] == 'C'){ cout << "YES" << endl; } else { cout << "NO" << endl; } }