N = int(eval(input()))

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

judge = False

for i in range(1, len(H)):

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

    H[i] -= 1

  elif H[i] - H[i-1] < 0:

    judge = True

    break

print(('No' if judge else 'Yes'))
eval(input());a=list(map(int,input().split()));b=sorted(a)

for i,j in zip(a,b):

  if abs(i-j)>1: print('No');break

else:

  print('Yes')
N = int(eval(input()))
H = list(map(int, input().split()))
judge = False
for i in range(1, len(H)):
    if H[i] - H[i - 1] >= 1:
        H[i] -= 1
    elif H[i] - H[i - 1] < 0:
        judge = True
        break
print(("No" if judge else "Yes"))

eval(input())
a = list(map(int, input().split()))
b = sorted(a)
for i, j in zip(a, b):
    if abs(i - j) > 1:
        print("No")
        break
else:
    print("Yes")

-N = int(eval(input())) -H = list(map(int, input().split())) -judge = False -for i in range(1, len(H)): -    if H[i] - H[i - 1] >= 1: -        H[i] -= 1 -    elif H[i] - H[i - 1] < 0: -        judge = True +eval(input()) +a = list(map(int, input().split())) +b = sorted(a) +for i, j in zip(a, b): +    if abs(i - j) > 1: +        print("No") -print(("No" if judge else "Yes")) +else: +    print("Yes")