import collections
n = int(input())
a = list(map(int,input().split()))
c = collections.Counter(a)
if len(c)>3:
    print('No')
elif len(c)==3:
    f = 0
    for i in c.keys():
        f^=i
    if f==0:
        print('Yes')
elif len(c)==2:
    if c[0]==n//3:
        print('Yes')
elif len(c)==1:
    if c[0]==n:
        print('Yes')
else:
    print('No')