from collections import Counter
def solve():
    N = int(input())
    A = list(map(int,input().split()))
    counter = Counter(A)

    if len(counter.keys()) != 3:
        print('No')
        return

    for _,val in counter.items():
        if val != N // 3:
            print('No')
            return
    
    print('Yes')

if __name__ == '__main__':
    solve()