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

if N%3:
    print('No')
    exit()

from collections import Counter
C = Counter(A)
if len(C) > 3:
    print('No')
    exit()

if len(C) == 1:
    print('Yes' if A[0]==0 else 'No')
elif len(C) == 2:
    if 0 not in C:
        print('No')
    elif C[0] != N//3:
        print('No')
    else:
        print('Yes')
else:
    if any(v!=N//3 for v in C.values()):
        print('No')
    else:
        a,b,c = list(C)
        print('Yes' if a^b == c else 'No')