from collections import Counter


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

if n % 3 != 0:
    if all(map(lambda e: e == 0, a)):
        print('Yes')
    else:
        print('No')

else:
    count = dict(Counter(a))
    if len(count) == 3:
        keys = list(count.keys())
        values = list(count.values())
        if values[0] == values[1] and values[1] == values[2] and (keys[0] ^ keys[1] ^ keys[2]) == 0:
            print('Yes')
        else:
            print('No')
    else:
        print('No')