n = int(eval(input()))

h = [int(i) for i in input().split()]

ans = 'Yes'

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

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

        h[i - 1] -= 1

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

        ans = 'No'

print(ans)
n = int(eval(input()))

h = [int(i) for i in input().split()]

ans = 'Yes'

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

    d = h[i - 1] - h[i]

    if d >= 2:

        ans = 'No'

        break

    elif d == 1:

        h[i - 1] -= 1

print(ans)
n = int(eval(input()))
h = [int(i) for i in input().split()]
ans = "Yes"
for i in range(n - 1, 0, -1):
    if h[i - 1] > h[i]:
        h[i - 1] -= 1
    if h[i - 1] > h[i]:
        ans = "No"
print(ans)

n = int(eval(input()))
h = [int(i) for i in input().split()]
ans = "Yes"
for i in range(n - 1, 0, -1):
    d = h[i - 1] - h[i]
    if d >= 2:
        ans = "No"
        break
    elif d == 1:
        h[i - 1] -= 1
print(ans)

-    if h[i - 1] > h[i]: +    d = h[i - 1] - h[i] +    if d >= 2: +        ans = "No" +        break +    elif d == 1: -    if h[i - 1] > h[i]: -        ans = "No"