from itertools import dropwhile,accumulate n=int(input()) a=list(dropwhile(lambda x:x==0,list(map(int,input().split()))[::-1]))[::-1] n=len(a) if any(a[i]>i+1 for i in range(n)): print("No") exit() b=list(accumulate(a[::-1])) for i in range(n): if b[i]%(n-i)!=0: print("No") break else: print("Yes")