max=input() while max: seq=map(int, raw_input().split()) tail=0 appendix=[] for truck in seq: if truck==tail+1: tail=truck else: appendix.append(truck) while appendix: if appendix[-1]==tail+1: tail=appendix.pop() else: break if appendix: print 'no' else: print 'yes' max=input()