from collections import Counter
N = int(input())
A = list(map(int, input().split()))
count = Counter(A)
if N % 3 != 0:
    print("No")
else:
    if len(count.keys()) == 3:
        for i in range(3):
            if list(count.values())[i] != N//3:
                print("No")
                break
        else:
            print("Yes")
    else:
        print("No")
