from collections import Counter

N = int(input())
a = [int(i) for i in input().split()]

c = list(Counter(a).values())
if len(c) == 3 and c[0] == c[1] == c[2] :
    print('Yes')
else :
    print('No')