{-# LANGUAGE BangPatterns, MultiWayIf #-}
import Control.Arrow
import Control.Monad.Fix
import Data.Int
import Data.Foldable
import Data.List
import Data.Bits
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import Data.ByteString.Internal (accursedUnutterablePerformIO)
import Debug.Trace

solve :: Int -> VU.Vector Int -> Bool
solve !n !vn =
  let ts = nub $ VU.toList vn
  in
    if length ts /= 3
    then
      False
    else
      let [x, y, z] = ts in x `xor` y == z || y `xor` z == x || z `xor` x == y

main = do
  let readInt :: Integral a => B.ByteString -> Maybe (a, B.ByteString)
      readInt = fmap (first fromIntegral . second B.tail) . B.readInt

  n  <- (\vec -> (vec VU.! 0)) . VU.unfoldrN 1 readInt <$> B.getLine
  vn <- VU.unfoldrN n readInt <$> B.getLine

  putStrLn $ if solve n vn then "Yes" else "No"
