[<Measure>] type h
type Dungeon = { Exp: int</h>; Death: int</h> }

let solve dungeons =
  dungeons
  |> Array.map (fun x -> x.Exp - 30000 * x.Death)
  |> Array.sortByDescending id
  |> Array.head
  |> fun x -> x * 6<h> >= 30000 * 100
  |> function | true -> "YES" | _ -> "NO"

let R() = stdin.ReadLine()

let N = R() |> int
let GD = Array.init N (fun _ ->
  let t = R().Split() |> Array.map (int>>(*)1</h>)
  { Exp = t.[0]; Death = t.[1]})

solve GD
|> stdout.WriteLine