#include #include #include #include using namespace std; struct Coord { int x, y; }; int main() { int n; std::cin >> n; struct Coord a; a.x = 2; a.y = 8; struct Coord b; b.x = 3; b.y = 9; struct Coord c; c.x = 7; c.y = 9; for (int i = 0; i < n; i++) { int x1, y1, x2, y2; std::cin >> x1 >> y1 >> x2 >> y2; struct Coord *focus; if (a.x == x1 && a.y == y1) focus = &a; else if (b.x == x1 && b.y == y1) focus = &b; else if (c.x == x1 && c.y == y1) focus = &c; else continue; focus->x = x2; focus->y = y2; } if (a.x == 5 && a.y == 8 && b.x == 4 && b.y == 8 && c.x == 6 && c.y == 8) { std::cout << "YES" << std::endl; } else { std::cout << "NO" << std::endl; } return 0; }