{-# LANGUAGE OverloadedStrings #-}
import           Data.Attoparsec.ByteString.Char8
import qualified Data.ByteString.Char8            as B
import qualified Data.IntSet                      as S

main :: IO ()
main = do
  Right ns <- parseOnly (decimal `sepBy` space) <$> B.getLine
  B.putStrLn $ if solve ns then "YES" else "NO"

solve :: [Int] -> Bool
solve ns = S.fromList ns == S.fromList [1,9,7,4]
