{-# 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 length as of
    1 -> let m = (fst.head) as
         in if | m == 1 -> "Yes"
               | m == n-1 -> "Yes"
               | n `div` m > 1 -> "Yes"
               | otherwise -> "No"
    2 -> let [(s,i),(t,j)] = as
         in if | s == t-1 && (n-i)`div`(s-i+1) > 1 -> "Yes"
               | otherwise -> "No"
    _ -> "No"
