from collections import Counter

N = int(input())
A = list(map(int,input().split()))

def solve():

    if N % 3 != 0:
        return all(a == 0 for a in A)



    counts, vals = zip(*sorted((c,v) for v,c in Counter(A).items()))

    if len(counts) == 1:
        return vals[0] == 0
    elif len(counts) == 2:
        return counts[0] == counts[1]*2 and vals[1] == 0
    elif len(counts) == 3:
        return counts[0] == counts[2] and (vals[0]^vals[1]^vals[2])==0
    else:
        return False

print('Yes' if solve() else 'No')
