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]
  let as' = (group.sort) as
      las' = length as'
  if n `mod` 3 /= 0 then putStrLn "No"
    else if las' > 3 then putStrLn "No"
      else if las' == 1 && all (== 0) as then putStrLn "Yes"
        else if las' == 2 && (length (as'!!0) == 2*(length $ as'!!1) || length (as'!!1) == 2*(length $ as'!!0)) then putStrLn "Yes"
          else if las' == 3 && length (as'!!0) == length (as'!!1) && length (as'!!1) == length (as'!!2) then putStrLn "Yes"
            else putStrLn "No"
