from collections import defaultdict as dd
n = int(input())
a = [int(i) for i in input().split()]
if sum(a):
    if n%3: f = 0
    else:
        d,x = dd(int),[]
        for i in a: d[i]+=1
        for i in d.keys(): x.append(i)
        if len(d)==2 and d[0]==n//3: f = 1
        elif len(d)==3 and x[0]^x[1]^x[2] and d[x[0]]==d[x[1]]==d[x[2]]: f = 1
        else: f = 0
else: f = 1
if f: print("Yes")
else: print("No")