import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List
import Data.Bits

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    as <- getIntList
    let gs = map (\g -> (head g, length g)) . group $ sort as
    putStrLn $ if check n gs then "Yes" else "No"

check n gs | l == 1 = fst (head gs) == 0 
           | n `mod` 3 /= 0 = False
           | l == 2 = let (a:b:_) = sort gs in fst a == 0 && snd a == (n `div` 3) && snd b == (2*n `div` 3)
           | l == 3 = let (a:b:c:_) = map fst gs in a `xor` b `xor` c == 0 && all (== n `div` 3) (map snd gs)
           | otherwise = False
           where l = length gs