n,*l=list(map(int,open(0).read().split()))

t=0

for i in l:

  if i<t: print('No'); break

  if i>t: i-=1

  t=i

else: print('Yes')
n,*l=list(map(int,open(0).read().split()))

t=0

for i in l:

  if i<t: print('No'); exit()

  if i>t: t=i-1

print('Yes')
n, *l = list(map(int, open(0).read().split()))
t = 0
for i in l:
    if i < t:
        print("No")
        break
    if i > t:
        i -= 1
    t = i
else:
    print("Yes")

n, *l = list(map(int, open(0).read().split()))
t = 0
for i in l:
    if i < t:
        print("No")
        exit()
    if i > t:
        t = i - 1
print("Yes")

-        break +        exit() -        i -= 1 -    t = i -else: -    print("Yes") +        t = i - 1 +print("Yes")