# -*- coding: utf-8 -*-
def solve():
    N = int(input())
    A = dict()
    for a in map(int, input().split()):
        A[a] = A.get(a,0) + 1
    if N % 3:
        if A.get(0,0) == N:
            return 'Yes'
        else:
            return 'No'
    else:
        if A.get(0,0) == N:
            return 'Yes'
        elif len(A) == 3:
            if len(set(A.values())) == 1:
                return 'Yes'
            else:
                return 'No'
        else:
            return 'No'

if __name__ == '__main__':
    print(solve())