N = int(input())
A = list(map(int, input().split()))
# print(N, A)

ans = list(set(A))
l = len(ans)
if l > 3:
    print('No')
    exit()

if l == 1:
    if ans[0] == 0:
        print('Yes')
    else:
        print('No')
    exit()

if l == 2:
    a0 = ans[0]
    a1 = ans[1]
    if a0 != 0 and a1 != 0:
        print('No')
    else:
        num_a0 = A.count(ans[0])
        num_a1 = A.count(ans[1])
        if num_a0 == num_a1:
            print('Yes')
        else:
            print('No')
    exit()

a0 = ans[0]
a1 = ans[1]
a2 = ans[2]

if a0 ^ a1 != a2:
    print('No')
    exit()

num_a0 = A.count(ans[0])
num_a1 = A.count(ans[1])
num_a2 = A.count(ans[2])

if num_a0 != num_a1 or num_a0 != num_a2:
    print('No')
else:
    print('Yes')
