N = int(eval(input()))

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



A = [-10 ** 18] + A

ans = "Yes"



for i in range(N):

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

        continue

    elif A[i] + 1 <= A[i + 1]:

        A[i + 1] -= 1

    else:

        ans = "No"

        break



print(ans)

N = int(eval(input()))

A = [0]+list(map(int, input().split()))



l = -1

ans = "Yes"

for i in range(1, N+1):

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

        A[i] -= 1

    elif A[i] == A[i-1]:

        continue

    else:

        ans = "No"

print(ans)
N = int(eval(input()))
A = list(map(int, input().split()))
A = [-(10**18)] + A
ans = "Yes"
for i in range(N):
    if A[i] == A[i + 1]:
        continue
    elif A[i] + 1 <= A[i + 1]:
        A[i + 1] -= 1
    else:
        ans = "No"
        break
print(ans)

N = int(eval(input()))
A = [0] + list(map(int, input().split()))
l = -1
ans = "Yes"
for i in range(1, N + 1):
    if A[i] > A[i - 1]:
        A[i] -= 1
    elif A[i] == A[i - 1]:
        continue
    else:
        ans = "No"
print(ans)

-A = list(map(int, input().split())) -A = [-(10**18)] + A +A = [0] + list(map(int, input().split())) +l = -1 -for i in range(N): -    if A[i] == A[i + 1]: +for i in range(1, N + 1): +    if A[i] > A[i - 1]: +        A[i] -= 1 +    elif A[i] == A[i - 1]: -    elif A[i] + 1 <= A[i + 1]: -        A[i + 1] -= 1 -        break