import Control.Applicative

countOcc :: Int -> [Int] -> Int
countOcc _ [] = 0
countOcc n (x:xs) | n == x = 1 + (countOcc n xs)
                  | otherwise = countOcc n xs

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 = countOcc 5 lst
        count7 = countOcc 7 lst
    myShow count5 count7
