import Data.List.Split

toInt :: String -> Int
toInt = read :: String -> Int

isHaiku :: [Int] -> String
isHaiku l
  | (sum l == 5+7+5) && (product l == 5*7*5) = "YES"
  | otherwise = "NO"

main = do
  s <- getLine
  putStrLn $ isHaiku (map toInt (splitOn " " s))