n=int(input())
a=list(map(int,input().split()))
L=[]
for i in range(25):
  L.append(2**i-1)
if n in L and max(a)==n and len(set(a))==n and 0 not in a:
  print('Yes')
elif len(set(a))==1 and a[0]==0:
  print('Yes')
else:
  print('No')