n = int(input()) 
a = list(map(int,input().split()))

q = n // 3 
r = n % 3

dic = {}
for i in range(n):
    if a[i] not in dic:
        dic[a[i]] = 1
    else:
        dic[a[i]] += 1

res = "No"

if len(dic) == 1:
    if a[0] == 0:
        res = "Yes"
elif len(dic) == 2:
    x,y = tuple(dic.keys())
    if x == 0 or y == 0:
        q = n // 2
        r = n % 2
        count1 = 0
        count2 = 0
        for i in (x,y):
            if dic[i] == q:
                count1 += 1
            elif dic[i] == q + 1:
                count2 += 1
        if count1 == 2 - r and count2 == r:
            res = "Yes"
elif len(dic) == 3:
    x,y,z = tuple(dic.keys())
    if x ^ y == z:
        count1 = 0
        count2 = 0
        for i in (x,y,z):
            if dic[i] == q:
                count1 += 1
            elif dic[i] == q + 1:
                count2 += 1
        if count1 == 3 - r and count2 == r:
            res = "Yes"
print(res)