from collections import Counter
N = int(input())
A = list(map(int, input().split()))

if N % 3 != 0:
    ans = "Yes" if sum(A) == 0 else "No"
else:
    B = Counter(A)
    if len(B) != 3:
        ans = "No"
    else:
        keys = tuple(B.keys())
        vals = tuple(B.values())
        if vals[0] == vals[1] and vals[1] == vals[2]:
            a, b, c = keys
            ans = "No" if a ^ b ^ c else "Yes"
        else:
            ans = "No"

print(ans)
