from collections import defaultdict

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

if N % 3 == 0:
    n = N // 3
    
    dic = defaultdict(int)
    for a in A:
        dic[a] += 1

        if dic[a] > n:
            print('No')
            exit()

else:
    print('No')