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
    print("Yes" if all([d[x] % (n//3) == 0 for x in d]) else "No")
else:
    print("Yes" if all([x == 0 for x in a]) else "No")