n = int(input())
a = list(map(int, input().split()))
a.sort()
if not n % 3 == 0:
    if a[n - 1] == 0:
        print("Yes")
    else:
        print("No")
else:
    x, y, z = a.count(a[0]), a.count(a[n // 3]), a.count(a[2 * (n // 3)])
    if x == y == z == n // 3:
        print("Yes")
    else:
        print("No")