n = int(input())
a = list(map(int, input().split()))
if n % 3 == 0:
    d = {}
    for x in a:
        d.setdefault(x, 0)
        d[x] += 1
    if len(d) > 3 or any([d[x] % (n//3) for x in d]):
        print("No")
        quit()
    if len(d) == 1 and 0 not in d:
        print("No")
        quit()
    if len(d) == 2 and d.get(0) != n//3:
        print("No")
        quit()
    print("Yes")
else:
    print("Yes" if all([x == 0 for x in a]) else "No")