from collections import Counter
N = int(input())
a = list(map(int,input().split()))
C = Counter(a)
if len(C) != 3 or N%3 != 0:
    print("No")
else:
    for e in C:
        if C[e] != N//3:
            print("No")
            exit(0)
    print("Yes")
