n = int(eval(input()))

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



if n == 1:

  print('Yes')

  exit()



for i in reversed(list(range(n))):

  if i == n-1:

    continue

  else:

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

      l[i] -= 1

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

      continue

    else:

      print('No')

      exit()

print('Yes')
n = int(eval(input()))

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

for i in reversed(list(range(n-1))):

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

        continue

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

        H[i] -= 1

    else:

        print('No')

        exit()

else:

    print('Yes')

n = int(eval(input()))
l = list(map(int, input().split()))
if n == 1:
    print("Yes")
    exit()
for i in reversed(list(range(n))):
    if i == n - 1:
        continue
    else:
        if l[i] == l[i + 1] + 1:
            l[i] -= 1
        elif l[i] <= l[i + 1]:
            continue
        else:
            print("No")
            exit()
print("Yes")

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

-l = list(map(int, input().split())) -if n == 1: +H = list(map(int, input().split())) +for i in reversed(list(range(n - 1))): +    if H[i] <= H[i + 1]: +        continue +    elif H[i] == H[i + 1] + 1: +        H[i] -= 1 +    else: +        print("No") +        exit() +else: -    exit() -for i in reversed(list(range(n))): -    if i == n - 1: -        continue -    else: -        if l[i] == l[i + 1] + 1: -            l[i] -= 1 -        elif l[i] <= l[i + 1]: -            continue -        else: -            print("No") -            exit() -print("Yes")