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

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

for ap in itertools.permutations(a):
    if check(N, list(ap)):
        print("Yes")
        sys.exit()
print("No")