import Control.Monad (replicateM) import Data.List (group, sort) import qualified Data.ByteString.Char8 as B solve :: Int -> [String] -> Bool solve n xs = m <= ((n+1) `div` 2) where m = maximum . map length . group . sort $ xs main :: IO () main = do n <- readLn :: IO Int xs <- replicateM n $ B.getLine putStrLn $ if solve n (map B.unpack xs) then "YES" else "NO"