N = int(eval(input()))

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



for i in range(N-1):

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

        H[i] -= 1

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

        if H[i]-1 >= 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()))

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



H[0] -= 1



for i in range(1, N):

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

        H[i] -= 1

    

    if not H[i-1] <= H[i]:

        print('No')

        exit()



print('Yes')
N = int(eval(input()))
H = list(map(int, input().split()))
for i in range(N - 1):
    if H[i] > H[i + 1]:
        H[i] -= 1
    elif H[i] == H[i + 1]:
        if H[i] - 1 >= 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()))
H = list(map(int, input().split()))
H[0] -= 1
for i in range(1, N):
    if H[i - 1] <= H[i] - 1:
        H[i] -= 1
    if not H[i - 1] <= H[i]:
        print("No")
        exit()
print("Yes")

-for i in range(N - 1): -    if H[i] > H[i + 1]: +H[0] -= 1 +for i in range(1, N): +    if H[i - 1] <= H[i] - 1: -    elif H[i] == H[i + 1]: -        if H[i] - 1 >= H[i - 1]: -            H[i] -= 1 -for i in range(N - 1): -    if H[i] > H[i + 1]: +    if not H[i - 1] <= H[i]: