from collections import Counter
N = int(input())
a_array = list(map(int,input().split()))

if N % 3 != 0:
    print("No")
    exit()
a = Counter(a_array)

if len(a) == 3:
    for d in a.values():
        if d != N // 3:
            print("No")
    else:
        print("Yes")
else:
    print("No")
