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

c = dict()

for x in a:
    if x not in c.keys():
        if len(c.keys()) >= 3:
            print('No')
            exit()
        else:
            c[x] = 1
    else:
        c[x] += 1

if len(c.keys()) == 1:
    if list(c.keys()) == 0:
        print('Yes')
    else:
        print('No')
elif len(c.keys()) == 2:
    p = [] + list(c.keys())
    p.sort()
    if p[0] != 0:
        print('No')
    elif c[p[0]] * 2 != c[p[1]]:
        print('No')
    else:
        print('Yes')
else:
    x, y, z = c.keys()
    if x ^ y ^ z != 0:
        print('No')
    elif c[x] != c[y] or c[y] != c[z]:
        print('No')
    else:
        print('Yes')