object Main extends App{
  val nwh = io.StdIn.readLine().split(' ').map(_.toInt)

  var row = Array.fill(nwh(2))(false)
  var col = Array.fill(nwh(1))(false)
//  var mas = Array.fill(nwh(2))(Array.fill(nwh(1))(false))

  for(i <- 0 until nwh(0)){
    val xyw = io.StdIn.readLine().split(' ').map(_.toInt)
    val miny = if(xyw(1) >= xyw(2)) xyw(1) - xyw(2) else 0
    val minx = if(xyw(0) >= xyw(2)) xyw(0) - xyw(2) else 0
    val maxy = if(xyw(1) + xyw(2) <= nwh(2)) xyw(1) + xyw(2) - 1 else nwh(2) - 1
    val maxx = if(xyw(0) + xyw(2) <= nwh(1)) xyw(0) + xyw(2) - 1 else nwh(1) - 1

    for(j <- miny to maxy){
      row(j) = true
    }

    for(k <- minx to maxx){
      col(k) = true
    }
  }

  println(if(row.count(p => p) == nwh(2) || col.count(p => p) == nwh(1)) "Yes" else "No")
}