import numpy as np
N = int(input())
a = input().split(" ")
A = [int(i) for i in a]

bit = [A[0],A[1]]
flag = 0
num = 2
while flag == 0:
    k = 0
    flag2 = 0
    for i in range(len(bit)):
        if i == 0:
            b = bin(bit[0]^bit[len(bit)-1])[2::]
            if b == np.binary_repr(A[num]):
                k = i
                flag2 = 1
                break
        else:
            b = bin(bit[i-1]^bit[i])[2::]
            if b == np.binary_repr(A[num]):
                k = i
                flag2 = 1
                break
    if flag2 == 1:
        bit.insert(k, A[num])
        num += 1
        if num == N:
            flag = 1
    if flag2 == 0:
        print("No")
        break
if flag == 1:
    print("Yes")