from collections import defaultdict

n = int(input())
a = tuple(map(int, input().split()))

if n == 3:
    if a[0] ^ a[2] == a[1] and a[1] ^ a[2] == a[0] and a[0] ^ a[1] == a[2]:
        print('Yes')
    else:
        print('No')
elif n % 3 == 0:
    d = defaultdict(int)
    for aa in a:
        d[aa] += 1
    m = n // 3
    bl = True
    for v in d.values():
        if v != m:
            bl = False
            break
    print('Yes' if bl else 'No')


else:
    if len(set(a)) == 1:
        print('Yes')
    else:
        print('No')
