import sys
input = sys.stdin.readline
from collections import Counter

N = int(input())

c = Counter((int(x) for x in input().split()))

# 0がある場合
# 0,x,x,0,x,x
# あるいは
# 0,0,0,0 (any length is ok)

if c[0] > 0:
    if len(c) == 1:
        bl = True
    else:
        if len(c) > 2:
            bl = False
        else:
            bl = (N == 3 * c[0])
else:
    # 0がない場合
    # x,y,z,x,y,z で3つとも異なる
    se = set(c.keys())
    if len(se) != 3:
        bl = False
    else:
        bl = True
        for key in se:
            if c[key] * 3 != N:
                bl = False


answer = 'Yes' if bl else 'No'
print(answer)