from collections import Counter
from sys import stdin

def main():
    N = int(input())
    A = map(int, input().split())

    cnt = Counter(A).most_common()
    if N % 3 or len(cnt) > 3:
        print('No')
        return

    n = N // 3
    for k, v in cnt:
        if not k and v == N:
            print('Yes')
            return
        elif v != n:
            print('No')
            return
    print('Yes')

input = lambda: stdin.readline()
main()
