def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    A.sort()
    if A[0] != 0 and A[0] != 1:
        return print("No")
    elif A[0] == 1:
        for i in range(N-1):
            if A[i] + 1 != A[i+1]:
                return print("No")
        c = A[-1] + 1
        ans = {2**i for i in range(2, 30)}
        if c in ans:
            return print("Yes")
        else:
            return print("No")
    elif A[0] == 0:
        from collections import Counter
        c = dict(Counter(A))
        if len(c.keys()) == 1:
            # all 0
            return print("Yes")
        elif len(c.keys()) > 2 or c[0] > 1 or N > 3:
            return print("No")
        else:
            return print("Yes")
    else:
        raise RuntimeWarning


if __name__ == '__main__':
    main()
