n = int(input())
a = [int(i) for i in input().split()]
d = dict()
for i in a:
    d.setdefault(i, 0)
    d[i] += 1
print("Yes" if(len(d) == 3 and len(set(d.values())) == 1 and n % 3 == 0) or (len(d) == 2 and (sorted(d.values())[0] == n // 3) and n % 3 == 0) or (sum(a) == 0) else "No")