#!/usr/bin/env python
# coding: utf-8

# -*- coding: utf-8 -*-
import itertools
import collections

def XORGate(a,b):
    if a == b:
        return "0"
    else :
        return "1"

N = int(input())
tmp = input().split()
hat_numbers = [bin(int(one))[2:] for one in tmp]
max_size = int(max(tmp))
hat_numbers = [one.zfill(max_size) for one in hat_numbers]
comb2 = []
comb_index = []
for i,one in enumerate(hat_numbers):
    for j,two in enumerate(hat_numbers):
        if i <= j :
            continue
        else:
            comb2.append((two,one))
            comb_index.append((j,i))
    

result_list_total = []
for one_a, one_b in comb2:
    result_list = []
    for i in range(max_size):
        result_list.append(XORGate(one_a[-i-1],one_b[-i-1]))
    
    tmp_str =""
    for i in range(max_size):
        tmp_str += result_list[-i-1]

    result_list_total +=[tmp_str]
    
    
cad_list = []
for (one_a, one_b),(index_a,index_b) in zip(comb2,comb_index):
    for i,one in enumerate(hat_numbers):
        if  i != index_a and i != index_b:
            if one in result_list_total:
                cad_list.append((one_a,one,one_b))
if len(cad_list) == 0:
    print("No")
else:
    c = collections.Counter(cad_list)
    correct = []
    cor_flag = True
    cad_list2 = []
    tmp_flags = []
    while cor_flag:
        if len(cad_list[0]) == N:
            print("Yes")
            cor_flag = False
        else:
            for one in hat_numbers:
                tmp_flag_1 = False
                tmp_flag_2 = False
                tmp_flag_3 = False
                for one_cad in c:
                    if tmp_flag_1 == False and one_cad[0] == one and c[one_cad] != 0:
                        c[one_cad] -= 1
                        tmp_flag_1 = True
                    if tmp_flag_2== False and one_cad[1] == one and c[one_cad] != 0:
                        c[one_cad] -= 1
                        tmp_flag_2 = True
                    if tmp_flag_3 == False and one_cad[2] == one and c[one_cad] != 0:
                        c[one_cad] -= 1
                        tmp_flag_3 = True

                    if tmp_flag_1 + tmp_flag_2 + tmp_flag_3 == 3:
                        break
                tmp_flags.append(tmp_flag_1 + tmp_flag_2 + tmp_flag_3)


            if sum(tmp_flags) == N*3:
                print("Yes")
                cor_flag = False
            else:
                print("No")
                cor_flag = False