open System
open System.Collections.Generic

let c5 number = 
    if number = 5 then 1
    else 0

let c7 number =
    if number = 7 then 1
    else 0

let last (abc : int list) = 
    if abc.[0] = 2 && abc.[1] = 1 then "YES"
    else "NO"


let rec check (check5, check7, index, abc :list<int>) : int list= 
    if index = abc.Length then [check5 ; check7]
    else check (check5 + (c5 abc.[index]), check7 + (c7 abc.[index]) ,(index + 1) ,abc)
[<EntryPointAttribute>]
let main argv =
    
    let abc = List.map (fun i -> int(Console.ReadLine())) [0;0;0]

    let temp :string = (last (check (0,0,0,abc)))

    printfn "%s" temp
    
    0