import sys
n=int(input())
a=list(map(int,input().split()))
if(n%3!=0):
    print("No")
else:
    nums=len(set(a))
    if(nums>3):
        print("No")
        sys.exit()

    x=len(a)//3
    for i in set(a):
        c=a.count(i)
        if(c!=x and c!=x*2 and c!=x*3):
            print("No")
            sys.exit()

    print("Yes")
