{-# LANGUAGE OverloadedStrings #-}
import Data.List
import qualified Data.ByteString.Char8 as B

main = breads >>= B.putStrLn . solve . sort

-- |
-- >>> solve [5, 5, 7]
-- "YES"
-- >>> solve [5, 7, 7]
-- "NO"
solve :: [Int] -> B.ByteString
solve [5, 5, 7] = "YES"
solve _ = "NO"

breads :: IO [Int]
breads = unfoldr uff <$> B.getLine
    where
        uff b = check <$> B.readInt b
        check (a, b)
            | B.null b = (a, b)
            | otherwise = (a, B.tail b)
