
import numpy as np 

def make_bit(A):
    arr = np.zeros(30)
    i = 29
    while A:
        arr[i] = A % 2
        A = A // 2
        i -= 1

    return arr

N = int(input())

a_lst = list(map(int, input().split()))



if N == 3:
    a_lst.sort(reverse=True)

    a1 = make_bit(a_lst[0])
    a2 = make_bit(a_lst[1])
    a3 = make_bit(a_lst[2])
    bits_arr = np.array([a1, a2, a3])

    judge = True
    for i in range(30):
        if bits_arr[0][i] == bits_arr[1][i] and bits_arr[2][i] == 1:
            judge = False
            break

        elif bits_arr[0][i] != bits_arr[1][i] and bits_arr[2][i] == 0:
            judge = False
            break
            
    if judge:
        print("Yes")
    else:
        print("No")


else:
    print("No")

