import System.IO

quick [] = []
quick (x:xs)=
    let sma_eq = [a | a <- xs,a <= x]
        lar    = [a | a <- xs,a >  x]
    in  quick sma_eq ++ [x] ++ quick lar


main = do
    ss <- (map read . words) <$> getLine
    if (sum ss == 17) && (minimum ss == 5) && (maximum ss ==7)
        then putStrLn "YES"
        else putStrLn "NO"