N = int(eval(input()))

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



is_Yes = True

for i in range(1, N):

    if Hs[i-1] == Hs[i]:

        continue

    elif Hs[i] > Hs[i-1]:

        Hs[i] -= 1

    else:

        is_Yes = False

        break



if is_Yes:

    print('Yes')

else:

    print('No')

n = int(eval(input()))

nums = [int(num) for num in input().split()]





def solve(nums):

    nums[0] -= 1

    for i in range(1, n):

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

            nums[i] -= 1

            continue

        if nums[i] < nums[i-1]:

            return 'No'

    return 'Yes'





print((solve(nums)))

N = int(eval(input()))
Hs = [int(i) for i in input().split()]
is_Yes = True
for i in range(1, N):
    if Hs[i - 1] == Hs[i]:
        continue
    elif Hs[i] > Hs[i - 1]:
        Hs[i] -= 1
    else:
        is_Yes = False
        break
if is_Yes:
    print("Yes")
else:
    print("No")

n = int(eval(input()))
nums = [int(num) for num in input().split()]


def solve(nums):
    nums[0] -= 1
    for i in range(1, n):
        if nums[i] > nums[i - 1]:
            nums[i] -= 1
            continue
        if nums[i] < nums[i - 1]:
            return "No"
    return "Yes"


print((solve(nums)))

-N = int(eval(input())) -Hs = [int(i) for i in input().split()] -is_Yes = True -for i in range(1, N): -    if Hs[i - 1] == Hs[i]: -        continue -    elif Hs[i] > Hs[i - 1]: -        Hs[i] -= 1 -    else: -        is_Yes = False -        break -if is_Yes: -    print("Yes") -else: -    print("No") +n = int(eval(input())) +nums = [int(num) for num in input().split()] + + +def solve(nums): +    nums[0] -= 1 +    for i in range(1, n): +        if nums[i] > nums[i - 1]: +            nums[i] -= 1 +            continue +        if nums[i] < nums[i - 1]: +            return "No" +    return "Yes" + + +print((solve(nums)))