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

def check(N, a):
    flag = True
    if( (a[-1] ^ a[1]) != a[0]):
        flag != False
    if( (a[-2] ^ a[0]) != a[-1]):
        flag != False
    for i in range(1, N-1):
        if not flag:
            break
        if( (a[i-1] ^ a[i+1]) != a[i]):
            flag = False
    return flag

for ap in itertools.permutations(a):
    f = check(N, list(ap))
    if f:
        break

if f:
    print("Yes")
else:
    print("No")