n = int(eval(input()))

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



for i in range(n):

	if i == 0:

		continue

	if arr[i] < arr[i-1]:

		print("No")

		exit()

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

		arr[i] -= 1

print("Yes")
N = int(eval(input()))

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

a = H[0]

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

    a = max(H[i], a)

    b = H[i+1]

    if a - b >= 2:

        print("No")

        exit()

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

N = int(eval(input()))
H = list(map(int, input().split()))
a = H[0]
for i in range(1, N - 1):
    a = max(H[i], a)
    b = H[i + 1]
    if a - b >= 2:
        print("No")
        exit()
print("Yes")

-n = int(eval(input())) -arr = list(map(int, input().split())) -for i in range(n): -    if i == 0: -        continue -    if arr[i] < arr[i - 1]: +N = int(eval(input())) +H = list(map(int, input().split())) +a = H[0] +for i in range(1, N - 1): +    a = max(H[i], a) +    b = H[i + 1] +    if a - b >= 2: -    if arr[i] > arr[i - 1]: -        arr[i] -= 1