n=int(eval(input()))

hi=[]

for i in map(int,input().split()):

    hi.append(i)

YesNo="Yes"    

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

    if hi[i]+2<=hi[i-1]:

        YesNo="No"    

#        print("No")

        break

    elif hi[i]+1==hi[i-1]:

        hi[i-1]=hi[i-1]-1

print(YesNo)


n=int(eval(input()))

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



yn=""

for i in  range(n-2,-1,-1):

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

        continue

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

        h[i]-=1

        continue

    else:

        yn="No"

        break

    

if yn=="No":

    print("No")

else:

    print("Yes")

        
n = int(eval(input()))
hi = []
for i in map(int, input().split()):
    hi.append(i)
YesNo = "Yes"
for i in range(n - 1, 1, -1):
    if hi[i] + 2 <= hi[i - 1]:
        YesNo = "No"
        #        print("No")
        break
    elif hi[i] + 1 == hi[i - 1]:
        hi[i - 1] = hi[i - 1] - 1
print(YesNo)

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

-hi = [] -for i in map(int, input().split()): -    hi.append(i) -YesNo = "Yes" -for i in range(n - 1, 1, -1): -    if hi[i] + 2 <= hi[i - 1]: -        YesNo = "No" -        #        print("No") +h = list(map(int, input().split())) +yn = "" +for i in range(n - 2, -1, -1): +    if h[i] <= h[i + 1]: +        continue +    elif h[i] == h[i + 1] + 1: +        h[i] -= 1 +        continue +    else: +        yn = "No" -    elif hi[i] + 1 == hi[i - 1]: -        hi[i - 1] = hi[i - 1] - 1 -print(YesNo) +if yn == "No": +    print("No") +else: +    print("Yes")