stdin.ReadLine().Split(' ') 
|> Array.map int
|> Array.groupBy (fun x -> x)
|> Array.where (fun x -> fst(x) = 5 && snd(x).Length = 2 || fst(x) = 7 && snd(x).Length = 1)
|> Array.length
|> fun x -> if x = 2 then "YES" else "NO"
|> printfn "%s"