import sys
input = sys.stdin.readline


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


import collections

c = collections.Counter(a)

klist = list(c.keys())
vlist = list(c.values())

if len(klist) == 1 and klist[0] == 0:
    print('Yes')
    sys.exit()

if len(klist) == 2:
    if (klist[0] == 0 and vlist[0] == N/3) or (klist[1] == 0 and vlist[1] == N/3):
        print('Yes')
        sys.exit()

if not len(klist) == 3:
    print('No')
    sys.exit()

if not (vlist[0] == vlist[1] and vlist[1] == vlist[2]):
    print('No')
    sys.exit()

if not (klist[0] ^ klist[1] == klist[2]):
    print('No3')
    sys.exit()

print('Yes')

