from bisect import bisect_left

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)

table = [[-1 for _ in range(n)] for _ in range(n)]
c = [0 for _ in range(n)]

for i in range(n):
    for j in range(n):
        table[i][j] = a[i] ^ a[j]
        if i != j:
            k = bisect_left(a, table[i][j])
            if k < len(c) and a[k] == table[i][j]:
                c[k] += 1
if all((cc == 2 for cc in c)):
    print('Yes')
else:
    print('No')

