import Control.Applicative

myShow :: Int -> Int -> IO ()
myShow count5 count7 | count5 == 2 && count7 == 1 = putStrLn "YES"
                     | otherwise = putStrLn "NO"

main :: IO ()
main = do
    lst <- map read . words <$> getLine
    let count5 = foldr (\x y -> if x == 5 then y+1 else y) 0 lst
        count7 = foldr (\x y -> if x == 7 then y+1 else y) 0 lst
    myShow count5 count7
