import scala.io.StdIn; object Solution { def main(args : Array[String]) = { val t = StdIn.readInt() var result : List[String] = Nil for(k <- 0 until t) { val n = StdIn.readInt() var flag : Int = 0 for(i <- 0 until n) { val Array(a,b) = StdIn.readLine().split(" ").map(_.toInt) if(a > 0 && b > 0) flag = 1 } if(flag == 0) result = result :+ "YES" else result = result :+ "NO" } result.foreach(println(_)) } }