import sys

input = sys.stdin.readline

N = int(input().strip())
As = list(map(int, input().strip().split(' ')))
candidates = list(set(As))

if len(candidates) > 3 or len(candidates) == 1:
    print('No')
elif len(candidates) == 2:
    if 0 in candidates:
        a, z = candidates
        if z == 0:
            a, z = z, a

        bits = format(z, '0b')

        if bits.find('0') == -1:
            count_a = 0
            count_z = 0
            for element in As:
                if element == 0:
                    count_z += 1
                else:
                    count_a += 1
            else:
                if count_a == count_z:
                    print('Yes')
                else:
                    print('No')
        else:
            print('No')
    else:
        print('No')
# len(candidates) == 3
else:
    a, b = candidates[:-1]
    c = candidates[-1]
    if a ^ b != c:
        print('No')
    else:
        count_a = 0
        count_b = 0
        count_c = 0
        for element in As:
            if element == a:
                count_a += 1
            elif element == b:
                count_b += 1
            else:
                count_c += 1
        else:
            if count_a == count_b and count_b == count_c:
                print('Yes')
            else:
                print('No')
