import Control.Applicative
import Control.Monad
import Data.List
import Data.Bool

main = interact $ bool "NO" "YES" . ((&&) <$> a <*> b) . group . sort . words
    where
        a l = length l == 4
        b l = length (filter ((==2) . length) l) == 2