main :: IO ()
main = do
  a <- words <$> getLine :: IO [String]
  if num "5" a == 2 && num "7" a == 1 then
    print "YES" 
  else
    print "NO" 
       where num v l = length $ filter (==v) l

                         
