import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
from collections import deque,defaultdict,Counter

def main():
    N = int(input())
    A = list(map(int,input().split()))
    if N%3 == 0:
        C = Counter(A)
        if len(C) == 3 and all(v*3 == N for v in C.values()):
            print('Yes')
        else:
            print('No')
    else:
        print('No')
if __name__ == '__main__':
    main()