import collections
def main():
    n = int(input())
    a = list(map(int,input().split()))
    cnt = collections.Counter(a)
    num = len(set(a))
    if sum(a) == 0:
        print('Yes')
        return
    if n % 3 != 0:
        print('No')
        return
    if len(cnt.most_common()) == 3:
        if cnt.most_common()[0][1] == cnt.most_common()[1][1] and cnt.most_common()[2][1] == cnt.most_common()[1][1] :
            print('Yes')
            return

    if len(cnt.most_common()) == 2:
        tmp_min = min(cnt.most_common()[0][1],cnt.most_common()[1][1])
        tmp_max = max(cnt.most_common()[0][1],cnt.most_common()[1][1])
        if tmp_max // tmp_min == 2:
            print('Yes')
            return
    print('No')

if __name__ == '__main__':
    main()
