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

cnt = [1, 1, 1]
ind = 0
if n % 3 != 0:
    print('No')
else:
    a.sort()
    for i in range(n - 1):
        if a[i] == a[i + 1]:
            cnt[ind] += 1
        else:
            ind += 1
            if ind > 2:
                break
    if (ind == 2) and (cnt[0] == n // 3) and (cnt[1] == n // 3) and (cnt[2] == n // 3):
        print('Yes')
    else:
        print('No')
