import sys
from collections import Counter

def main():
    input = sys.stdin.readline
    N = int(input())
    A = list(map(int, input().split()))

    c = Counter(A)
    if 0 in c and len(c) == 1:
        return 'Yes'

    if 0 in c and len(c) == 2:
        v0 = c[0]
        for k, v in c.items():
            if k != 0 and v == 2 * v0:
                return 'Yes'

    if len(c) == 3:
        vals = set()
        for v in c.values():
            vals.add(v)

        if len(vals) == 1:
            return 'Yes'

    return 'No'


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