N = int(eval(input()))

H = [int(h) for h in input().split()]



if N == 1:

    ans = "Yes"

else:

    c = 0

    while c <= N-2:

        if H[c] < H[c+1]:

            H[c+1] -= 1

        c += 1

    List = []

    for j in range(N):

        List.append(H[j])

    List.sort()

    if List == H:

        ans = "Yes"

    else:

        ans = "No"



print(ans)
N = int(eval(input()))

H = [int(h) for h in input().split()]



ans = "Yes"

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

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

        H[i] -= 1

    if H[i] > H[i+1]:

        ans = "No"

        break

print(ans)
N = int(eval(input()))
H = [int(h) for h in input().split()]
if N == 1:
    ans = "Yes"
else:
    c = 0
    while c <= N - 2:
        if H[c] < H[c + 1]:
            H[c + 1] -= 1
        c += 1
    List = []
    for j in range(N):
        List.append(H[j])
    List.sort()
    if List == H:
        ans = "Yes"
    else:
        ans = "No"
print(ans)

N = int(eval(input()))
H = [int(h) for h in input().split()]
ans = "Yes"
for i in range(1, N - 1):
    if H[i] > H[i - 1]:
        H[i] -= 1
    if H[i] > H[i + 1]:
        ans = "No"
        break
print(ans)

-if N == 1: -    ans = "Yes" -else: -    c = 0 -    while c <= N - 2: -        if H[c] < H[c + 1]: -            H[c + 1] -= 1 -        c += 1 -    List = [] -    for j in range(N): -        List.append(H[j]) -    List.sort() -    if List == H: -        ans = "Yes" -    else: +ans = "Yes" +for i in range(1, N - 1): +    if H[i] > H[i - 1]: +        H[i] -= 1 +    if H[i] > H[i + 1]: +        break