n,*a=map(int,open(0).read().split()) t=n k=1 while a: c=a.pop() if c==0: 0 elif c+t==n: t+=c else: k=0 n-=1 print('YNeos'[k::2])