N=int(eval(input()))

matchNums=input().split(" ")

matchNums=list(map(int, matchNums))

plus_flgs=[-1]



if len(matchNums)==1:

    print("Yes")

    

else:

    check_array=[]

    check_array_all=[]

    

    for i in range(len(matchNums)-1):

        check_array.append((matchNums[i+1] - matchNums[i]))

    

#     for i in range(len(check_array)-1):

#         check_array_all.append((check_array[i+1] + check_array[i]))

    #プラスとプラスの間を足す

    #プラスのinedex取得

    for i,val in enumerate(check_array):

        if val > 0:

            plus_flgs.append(i)

    

    # 最後がマイナスで終わるとき対策

    plus_flgs.append(len(check_array))

#     print(plus_flgs)

#     print(check_array)

    for i in range(len(plus_flgs)-1):

        check_array_all.append(sum(check_array[plus_flgs[i]+1: plus_flgs[i+1]]))

#     print(check_array_all)

    # プラスとプラスの間の和が-2の物があったらＮＧ

    if min(check_array_all)<-1:

        print("No")

    else:

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

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



flg=True

temp_max=0



for i in range(N-1):

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

        flg=False

        break

        

    if temp_max - H[i+1] >= 2:

        flg=False

        break

    elif temp_max<H[i+1]:

        temp_max = H[i+1]

if flg:

    print("Yes")

else:

    print("No")
N = int(eval(input()))
matchNums = input().split(" ")
matchNums = list(map(int, matchNums))
plus_flgs = [-1]
if len(matchNums) == 1:
    print("Yes")
else:
    check_array = []
    check_array_all = []
    for i in range(len(matchNums) - 1):
        check_array.append((matchNums[i + 1] - matchNums[i]))
    #     for i in range(len(check_array)-1):
    #         check_array_all.append((check_array[i+1] + check_array[i]))
    # プラスとプラスの間を足す
    # プラスのinedex取得
    for i, val in enumerate(check_array):
        if val > 0:
            plus_flgs.append(i)
    # 最後がマイナスで終わるとき対策
    plus_flgs.append(len(check_array))
    #     print(plus_flgs)
    #     print(check_array)
    for i in range(len(plus_flgs) - 1):
        check_array_all.append(sum(check_array[plus_flgs[i] + 1 : plus_flgs[i + 1]]))
    #     print(check_array_all)
    # プラスとプラスの間の和が-2の物があったらＮＧ
    if min(check_array_all) < -1:
        print("No")
    else:
        print("Yes")

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

-matchNums = input().split(" ") -matchNums = list(map(int, matchNums)) -plus_flgs = [-1] -if len(matchNums) == 1: +H = list(map(int, input().split())) +flg = True +temp_max = 0 +for i in range(N - 1): +    if H[i] - H[i + 1] >= 2: +        flg = False +        break +    if temp_max - H[i + 1] >= 2: +        flg = False +        break +    elif temp_max < H[i + 1]: +        temp_max = H[i + 1] +if flg: -    check_array = [] -    check_array_all = [] -    for i in range(len(matchNums) - 1): -        check_array.append((matchNums[i + 1] - matchNums[i])) -    #     for i in range(len(check_array)-1): -    #         check_array_all.append((check_array[i+1] + check_array[i])) -    # プラスとプラスの間を足す -    # プラスのinedex取得 -    for i, val in enumerate(check_array): -        if val > 0: -            plus_flgs.append(i) -    # 最後がマイナスで終わるとき対策 -    plus_flgs.append(len(check_array)) -    #     print(plus_flgs) -    #     print(check_array) -    for i in range(len(plus_flgs) - 1): -        check_array_all.append(sum(check_array[plus_flgs[i] + 1 : plus_flgs[i + 1]])) -    #     print(check_array_all) -    # プラスとプラスの間の和が-2の物があったらＮＧ -    if min(check_array_all) < -1: -        print("No") -    else: -        print("Yes") +    print("No")