N = int(input())
A = list(map(int, input().split()))
B = sorted(set(A))
if N % 3 == 0:
    if len(B) == 1 and B[0] == 0:
        print('Yes')
        exit()
    if len(B) == 2 and A.count(0) == N // 3 and A.count(B[1]) == 2 * N // 3:
        if B[0] ^ B[1] ^ B[2] == 0:
            print('Yes')
            exit()
    if len(B) == 3 and A.count(B[0]) == A.count(B[1]) == A.count(B[2]):
        print('Yes')
        exit()

print('No')
