#https://atcoder.jp/contests/abc136/tasks/abc136_c



n = int(eval(input()))

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



a = []

flag = 'Yes'

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

    if h[i+1] - h[i] < 0 and h[i+1] - h[i] > -2:

        h[i] -= 1

    elif h[i+1] - h[i] < -1:

        flag = 'No'

print(flag)
#https://atcoder.jp/contests/abc136/tasks/abc136_c



n = int(eval(input()))

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



flag = 'Yes'

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

    if h[i+1] - h[i] < 0 and h[i+1] - h[i] > -2:

        h[i] -= 1

    elif h[i+1] - h[i] <= -2:

        flag = 'No'

        break

print(flag)
# https://atcoder.jp/contests/abc136/tasks/abc136_c
n = int(eval(input()))
h = [int(i) for i in input().split()]
a = []
flag = "Yes"
for i in reversed(list(range(n - 1))):
    if h[i + 1] - h[i] < 0 and h[i + 1] - h[i] > -2:
        h[i] -= 1
    elif h[i + 1] - h[i] < -1:
        flag = "No"
print(flag)

# https://atcoder.jp/contests/abc136/tasks/abc136_c
n = int(eval(input()))
h = [int(i) for i in input().split()]
flag = "Yes"
for i in reversed(list(range(n - 1))):
    if h[i + 1] - h[i] < 0 and h[i + 1] - h[i] > -2:
        h[i] -= 1
    elif h[i + 1] - h[i] <= -2:
        flag = "No"
        break
print(flag)

-a = [] -    elif h[i + 1] - h[i] < -1: +    elif h[i + 1] - h[i] <= -2: +        break