import itertools
n = int(input())
a = list(map(int, input().split()))
ok = False
for v in itertools.permutations(a):
    v = v+v[:2]
    for i in range(n):
        if v[i+1] != int(bin(v[i] ^ v[i+2])[2:], 2): break
        if i == n-1:
            if v[i+1] == int(bin(v[i] ^ v[i+2])[2:], 2):
                ok = True
    if ok: break
print("Yes" if ok else "No")