{-# LANGUAGE MultiWayIf #-}
import Data.List (sort,group)
import Control.Arrow ((&&&))

main = do
  n <- read <$> getLine :: IO Int
  as <- map (head&&&length).group.sort.map read.words <$> getLine :: IO [(Int,Int)]
  putStrLn $ case as of
    [(m,_)] -> if | m == 1 -> "Yes"
                  | m == n-1 -> "Yes"
                  | n `div` m > 1 -> "Yes"
                  | otherwise -> "No"
    [(s,i),(t,_)] -> if | s == t-1 && s<i -> "No"
                        | s == t-1 && (n-i)`div`(s-i+1) > 1 -> "Yes"
                        | otherwise -> "No"
    _ -> "No"
