#include using namespace std; int main(){ char mas[30][30]; memset(mas, '.', sizeof(mas)); mas[2][8] = 'A'; mas[3][9] = 'B'; mas[7][9] = 'C'; int n; cin >> n; for(int i = 0;i < n;i++){ int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; mas[x2][y2] = mas[x1][y1]; mas[x1][y1] = '.'; } if(mas[5][8] == 'A' && mas[4][8] == 'B' && mas[6][8] == 'C'){ cout << "YES" << endl; }else{ cout << "NO" << endl; } return 0; }