from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N = inp()
aa = inpl()

def product():
    if N != 3:
        for a in aa:
            if a != aa[0]:
                return 'No'
        return 'Yes'
    else:
        if aa[0]^aa[1] != aa[2]:
            return 'No'
        if aa[1]^aa[2] != aa[0]:
            return 'No'
        if aa[2]^aa[0] != aa[1]:
            return 'No'
        return 'Yes'


print(product())
