{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.Maybe
import Debug.Trace
import Data.List
import qualified Data.Map.Strict as Map
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Set as Set
import qualified Data.IntSet as IntSet
import Data.Functor
import Data.Array
-- import Data.Array.Unboxed
import Control.Monad.ST
import Data.Array.ST
import Data.Bits

main :: IO ()
main = do
  n <- readLn :: IO Int
  as <- map read . words <$> getLine :: IO [Int]
  putStrLn $ if solve'' n as then "Yes" else "No"


solve'' n as = patternA || patternB || patternC
  where
    patternA = (length as) `mod` 3 == 0
      && keyCond
      && countCond
    patternB = all (0==) as
    patternC = (length keys) == 2
        && min fs sn == 0
        && (mp Map.! (min fs sn)) * 2 == mp Map.! (max fs sn)
    mp = toCountMap as
    keys = Map.keys mp
    (a:b:c:_) = keys
    (fs:sn:_) = keys
    keyCond = xor a b == c && xor b c == a && xor c a == b 
    countCond = mp Map.! a == mp Map.! b && mp Map.! a == mp Map.! c
  

toCountMap :: (Ord k) => [k] -> Map.Map k Int
toCountMap = Map.fromListWith (+) . flip zip (repeat 1)
    
