from collections import defaultdict

N = int(input())
A = list(map(int, input().split()))

dic = defaultdict(int)

for a in A:
    dic[a] += 1

n = len(dic.keys())

if n != 3:
    print('No')
else:
    if min(dic.values()) == max(dic.values()):
        print('Yes')
    else:
        print('No')