N = int(eval(input()))

A=list(map(int,input().split()))

ask=0

#N-1~1までループ

for x in range(N-1,0,-1):

    if A[x]-A[x-1]<0:

        A[x-1]=A[x-1]-1

for x in range(1,N):

    if A[x]-A[x-1]<0:

        ask=1

        break

if ask==0:

    print('Yes')

else:

    print('No')

n=int(eval(input()))

h=list(map(int,input().split()))

for i in range(n-2,-1,-1):

    if h[i]>h[i+1]:

        h[i]-=1

for i in range(n-1):

    if h[i]>h[i+1]:

        print("No")

        exit()

print("Yes")
N = int(eval(input()))
A = list(map(int, input().split()))
ask = 0
# N-1~1までループ
for x in range(N - 1, 0, -1):
    if A[x] - A[x - 1] < 0:
        A[x - 1] = A[x - 1] - 1
for x in range(1, N):
    if A[x] - A[x - 1] < 0:
        ask = 1
        break
if ask == 0:
    print("Yes")
else:
    print("No")

n = int(eval(input()))
h = list(map(int, input().split()))
for i in range(n - 2, -1, -1):
    if h[i] > h[i + 1]:
        h[i] -= 1
for i in range(n - 1):
    if h[i] > h[i + 1]:
        print("No")
        exit()
print("Yes")

-N = int(eval(input())) -A = list(map(int, input().split())) -ask = 0 -# N-1~1までループ -for x in range(N - 1, 0, -1): -    if A[x] - A[x - 1] < 0: -        A[x - 1] = A[x - 1] - 1 -for x in range(1, N): -    if A[x] - A[x - 1] < 0: -        ask = 1 -        break -if ask == 0: -    print("Yes") -else: -    print("No") +n = int(eval(input())) +h = list(map(int, input().split())) +for i in range(n - 2, -1, -1): +    if h[i] > h[i + 1]: +        h[i] -= 1 +for i in range(n - 1): +    if h[i] > h[i + 1]: +        print("No") +        exit() +print("Yes")