{-# 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 = f as mp
  where
    mp = toCountMap $ drop 2 as
    f :: [Int] -> Map.Map Int Int -> Bool
    f (a:b:[]) _ = (a `xor` b) == (head as)
    f (a:b:as) m
      | Map.member x m = if m Map.! x > 0 
          then f (b:as) $ Map.adjust (\y -> y-1) x m
          else False
      | otherwise = False
      where x = (a `xor` b)


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