from itertools import permutations
N = int(input())
A = list(map(int, input().split()))
per_A = list(permutations(A, len(A)))
def f(A):
    no = 0
    new_A =[A[-1]] + A + [A[0]]
    for i in range(1,N+1):
        a,b,c = new_A[i-1],new_A[i],new_A[i+1]
        a_bin = format(a,"b")
        c_bin = format(c,"b")
        ac = str(int(a_bin) + int(c_bin))
        x = "0b"
        for i in range(len(ac)):
            if int(ac[i]) % 2 == 1:
                x += "1"
            else:
                x += "0"
        if int(x,0) != b:
            no = 1
            break
    return no
No = 0
for a in per_A:
    No += f(list(a))
if No == 0:
    print("Yes")
else:
    print("No")