{-# LANGUAGE OverloadedStrings #-} import Control.Applicative ((<$>)) import qualified Data.ByteString.Char8 as C import Data.List (maximumBy) import Data.Ord (comparing) import qualified Data.Map.Strict as M import Data.Maybe (fromJust) type Count = Int type Counter a = M.Map a Count addElement :: Ord a => a -> Counter a -> Counter a addElement x = M.insertWith (+) x 1 countElements :: Ord a => [a] -> Counter a countElements = foldr addElement M.empty mostCommonElement :: Ord a => Counter a -> (a, Count) mostCommonElement = maximumBy (comparing snd) . M.assocs judge :: Ord a => Count -> [a] -> Bool judge n xs = l >= m where l = flip div 2 $ n + 1 m = snd . mostCommonElement $ countElements xs unsafeReadInt :: C.ByteString -> Int unsafeReadInt = fst . fromJust . C.readInt main :: IO () main = do n <- unsafeReadInt <$> C.getLine xs <- C.lines <$> C.getContents C.putStrLn $ if judge n xs then "YES" else "NO"