N=int(eval(input()))

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

h=H[::-1]

a=True

 

for i in range(N-1):

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

        if h[i+1]-h[i] <= 1:

            h[i+1] -=1

        else:

            a = False

            break

if a:

    print('Yes')

else:

    print('No')
N = int(eval(input()))

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

H = h[::-1]

a = True

for i in range(N-1):

    if H[i]<=H[i+1]:

        if H[i]+1==H[i+1]:

            H[i+1] -= 1

        elif H[i+1]>=H[i]+2:

            a = False

            break



for i in range(N-1):

    if H[i]>=H[i+1]:

        a = True

    else:

        a = False

        break

if a:

    print('Yes')

else:

    print('No')

        
N = int(eval(input()))
H = list(map(int, input().split()))
h = H[::-1]
a = True
for i in range(N - 1):
    if h[i] < h[i + 1]:
        if h[i + 1] - h[i] <= 1:
            h[i + 1] -= 1
        else:
            a = False
            break
if a:
    print("Yes")
else:
    print("No")

N = int(eval(input()))
h = list(map(int, input().split()))
H = h[::-1]
a = True
for i in range(N - 1):
    if H[i] <= H[i + 1]:
        if H[i] + 1 == H[i + 1]:
            H[i + 1] -= 1
        elif H[i + 1] >= H[i] + 2:
            a = False
            break
for i in range(N - 1):
    if H[i] >= H[i + 1]:
        a = True
    else:
        a = False
        break
if a:
    print("Yes")
else:
    print("No")

-H = list(map(int, input().split())) -h = H[::-1] +h = list(map(int, input().split())) +H = h[::-1] -    if h[i] < h[i + 1]: -        if h[i + 1] - h[i] <= 1: -            h[i + 1] -= 1 -        else: +    if H[i] <= H[i + 1]: +        if H[i] + 1 == H[i + 1]: +            H[i + 1] -= 1 +        elif H[i + 1] >= H[i] + 2: +for i in range(N - 1): +    if H[i] >= H[i + 1]: +        a = True +    else: +        a = False +        break