import Data.List

solve :: String -> String
solve line = if prob>=0.5 then "YES" else "NO"
    where c = map (\s->read s::Int) $ words $ line
          lc4 = delete (c!!0) $ delete (c!!1) $ delete (c!!2) [1..10]
          nunder20 = realToFrac $ length $ filter (\c4->((c!!0)+(c!!1)+c4)<=20) lc4
          prob = nunder20 * (1.0/7.0)
main = do
    str <- getContents 
    mapM_ putStrLn $ map solve $ lines $ str