import Data.List

main = do
  str <- getLine
  putStrLn $ isHaiku str

isHaiku :: String -> String
isHaiku str
  | list == [5, 5, 7] = "YES"
  | otherwise =	"NO"
  where
    list = sort $ map (read :: String -> Int) $ words str