import Control.Monad

main = do
    a <- map read . words <$> getLine :: IO [Int]
    let ans = filter (/=1) $ filter (/=7) $ filter (/=9) $ filter (/=4) a
    if length ans == 0 then putStrLn $ "YES" else putStrLn $ "NO"