#include using namespace std; int main(){ int N; cin >> N; int A[10][10] = {0}; A[2][8] = 1; A[3][9] = 2; A[7][9] = 3; for(int t=0; t> x1 >> y1 >> x2 >> y2; A[x2][y2] = A[x1][y1]; A[x1][y1] = 0; } if(A[5][8] == 1 && A[4][8] == 2 && A[6][8] == 3){ cout << "YES" << endl; }else{ cout << "NO" << endl; } return 0; }