import Data.Bits
import Data.List
import Control.Monad
import qualified Data.Vector.Unboxed as V
import Control.Monad.ST
import Data.Maybe (fromMaybe)
import qualified Data.ByteString.Lazy.Char8 as B
import Debug.Trace

main :: IO ()
main = do
  n <- readLn :: IO Int
  as <- map read.words <$> getLine :: IO [Int]
  if n `mod` 3 /= 0 then putStrLn "No"
    else if (length.group.sort) as /= 3 then putStrLn "No"
      else putStrLn "Yes"
