n = gets.chomp.to_i rook = [2,8] silver_r = [3,9] silver_l = [7,9] n.times { x1, y1, x2, y2 = gets.chomp.split.map &:to_i dst = [x2, y2] case [x1, y1] when rook rook = dst when silver_r silver_r = dst when silver_l silver_l = dst end } if rook == [5,8] and silver_r == [4,8] and silver_l == [6,8] puts "YES" else puts "NO" end