import Data.Maybe
import Data.List
import Control.Monad
import qualified Data.ByteString.Char8 as C

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt

x ? (a,b) = if x then a else b
half = flip div 2
aliq = ((0==).).mod

xor :: [Bool] -> [Bool] -> [Bool]
xor [] [] = []
xor a [] = xor a [True]
xor [] b = xor [True] b
xor a b = [b'?(a',not a')] ++ xor as bs where
 a' = head a
 b' = head b
 as = tail a
 bs = tail b

i2b :: Int -> [Bool]
i2b n = [even n] ++ (n==0)?([],i2b (half n))

b2i :: [Bool] -> Int
b2i s = b2i2 0 $ reverse s where
 b2i2 ans (a:as) = (null as)?(ans',b2i2 ans' as) where
   ans' = 2 * ans + a?(0,1)

exor a b = b2i (xor (i2b a) (i2b b))

main = do
  getLine
  inputs <- readLnInt
  putStr $ (solve inputs)?("Yes","No")

solve s = calc (nub s)

calc s | length s > 3 = False
 | length s == 3 = check3 s
 | length s == 2 = check2 s
 | length s == 1 = check1 s

check3 [a,b,c] = c == (exor a b)
check2 [a,b] = check3[a,b,a] || check3[a,b,b]
check1 [a] = check3 [a,a,a]
