import collections
import itertools

n = int(input())
ls = list(map(int, input().split()))
counter = collections.Counter()
for x in ls:
    counter[x] += 1
if len(counter.keys()) > 3:
    print('No')
else:
    for a, b in itertools.combinations(counter.keys(), 2):
        if a == b and counter[a] == 1:
            continue
        counter2 = collections.Counter()
        x = a
        counter2[a] += 1
        counter2[b] += 1
        for _ in range(n - 2):
            a, b = b, a ^ b
            counter2[b] += 1
            if counter2[b] > counter[b]:
                break
        else:
            if a ^ b != x:
                continue
            else:
                print('Yes')
                break
    else:
        print('No')