N = int(eval(input()))

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



pre = -999

for i in range(N):

  if pre <= H[i]-1:

    pre = H[i]-1

  elif pre <= H[i]:

    pre = H[i]

  else:

    print("No")

    exit()

  

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

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



next = 10**9

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

  if H[i] <= next:

    next = H[i]

  elif H[i]-1 <= next:

    next = H[i]-1

  else:

    print("No")

    exit()

  

print("Yes")
N = int(eval(input()))
H = list(map(int, input().split()))
pre = -999
for i in range(N):
    if pre <= H[i] - 1:
        pre = H[i] - 1
    elif pre <= H[i]:
        pre = H[i]
    else:
        print("No")
        exit()
print("Yes")

N = int(eval(input()))
H = list(map(int, input().split()))
next = 10**9
for i in range(N - 1, 0, -1):
    if H[i] <= next:
        next = H[i]
    elif H[i] - 1 <= next:
        next = H[i] - 1
    else:
        print("No")
        exit()
print("Yes")

-pre = -999 -for i in range(N): -    if pre <= H[i] - 1: -        pre = H[i] - 1 -    elif pre <= H[i]: -        pre = H[i] +next = 10**9 +for i in range(N - 1, 0, -1): +    if H[i] <= next: +        next = H[i] +    elif H[i] - 1 <= next: +        next = H[i] - 1