from collections import Counter

if __name__ == '__main__':
    n = int(input())
    l = list(map(int, input().split()))
    c = Counter(l)
    size = len(c.most_common())
    if size > 3:
        print("No")
        exit()
    if size == 1:
        a, b = c.most_common()[0]
        if a == 0 and b == n:
            print("Yes")
        else:
            print("No")
        exit()
    if size == 2:
        a1, b1 = c.most_common()[0]
        a2, b2 = c.most_common()[1]
        if a1 != 0 and b1 == 2 * n / 3 and a2 == 0 and b2 == n / 3:
            print("Yes")
        else:
            print("No")
        exit()
    a1, b1 = c.most_common()[0]
    a2, b2 = c.most_common()[1]
    a3, b3 = c.most_common()[2]
    if b1 == n/3 and b2 == n/3 and b3 == n/3:
        print("Yes")
    else:
        print("No")
    exit()
