n=int(input())
a=list(map(int,input().split()))
a.sort()
if sum(a)==0:
    print('Yes')
    exit()
    
if n%3==0 and a.count(a[0])%(n//3) == a.count(a[-1])%(n//3) == a.count(a[len(a)//2])%(n//3)==0:
    print("Yes")
else:
    print('No')