import Data.List main = do n <- readLn eto <- getContents >>= return . map length . group . sort . lines putStrLn $ if filter (> ceiling((fromIntegral n) / 2)) eto == [] then "YES" else "NO"