def getlist():
    return list(map(int, input().split()))

N = int(input())
a = getlist()
a = sorted(a)

if N % 3 != 0:
    if a[-1] >= 1:
        print("No")
    else:
        print("Yes")
else:
    m = int(N // 3)
    if a[0] == a[m - 1] and a[m] == a[2 * m - 1] and a[2 * m] == a[3 * m - 1]:
        print("Yes")
    else:
        print("No")