import Data.List

main = do
  str <- getLine
  let n = read str ::Int
  str <- getLine
  let a = take n $ map read (words str) ::[Int]
  let ans = and $ map (isOne . length) $ (group . sort) a
  if ans == True
    then putStrLn "YES"
    else putStrLn "NO"


isOne :: Int -> Bool
isOne 1 = True
isOne x = False