#!usr/bin/env python3

from collections import defaultdict,deque

from heapq import heappush, heappop

import sys

import math

import bisect

import random

def LI(): return [int(x) for x in sys.stdin.readline().split()]

def I(): return int(sys.stdin.readline())

def LS():return [list(x) for x in sys.stdin.readline().split()]

def S():

    res = list(sys.stdin.readline())

    if res[-1] == "\n":

        return res[:-1]

    return res



def IR(n):

    return [I() for i in range(n)]

def LIR(n):

    return [LI() for i in range(n)]

def SR(n):

    return [S() for i in range(n)]

def LSR(n):

    return [LS() for i in range(n)]



sys.setrecursionlimit(1000000)

mod = 1000000007



#A

def A():

    a,b,c = LI()

    c -= a-b

    print((max(0,c)))

    return



#B

def B():

    n = I()

    ans = 0

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

        s = str(i)

        if len(s)%2:

            ans += 1

    print(ans)

    return



#C

def C():

    n = I()

    h = LI()

    h[0] -= 1

    for i in range(n-1):

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

            print("No")

            return

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

            h[i+1] -= 1

    print("Yes")

    return



#D

def D():



    return



#E

def E():



    return



#F

def F():



    return



#Solve

if __name__ == "__main__":

    C()

#!usr/bin/env python3

from collections import defaultdict, deque

from heapq import heappush, heappop

from itertools import permutations, accumulate

import sys

import math

import bisect

def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]

def I(): return int(sys.stdin.buffer.readline())

def LS():return [list(x) for x in sys.stdin.readline().split()]

def S():

    res = list(sys.stdin.readline())

    if res[-1] == "\n":

        return res[:-1]

    return res

def IR(n):

    return [I() for i in range(n)]

def LIR(n):

    return [LI() for i in range(n)]

def SR(n):

    return [S() for i in range(n)]

def LSR(n):

    return [LS() for i in range(n)]



sys.setrecursionlimit(1000000)

mod = 1000000007



def solve():

    n = I()

    h = LI()

    m = h[0]-1

    for i in h[1:]:

        if m > i:

            print("No")

            return

        m = max(m,i-1)

    print("Yes")

    return



#Solve

if __name__ == "__main__":

    solve()

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random


def LI():
    return [int(x) for x in sys.stdin.readline().split()]


def I():
    return int(sys.stdin.readline())


def LS():
    return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007
# A
def A():
    a, b, c = LI()
    c -= a - b
    print((max(0, c)))
    return


# B
def B():
    n = I()
    ans = 0
    for i in range(1, n + 1):
        s = str(i)
        if len(s) % 2:
            ans += 1
    print(ans)
    return


# C
def C():
    n = I()
    h = LI()
    h[0] -= 1
    for i in range(n - 1):
        if h[i + 1] < h[i]:
            print("No")
            return
        if h[i + 1] > h[i]:
            h[i + 1] -= 1
    print("Yes")
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Solve
if __name__ == "__main__":
    C()

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect


def LI():
    return [int(x) for x in sys.stdin.buffer.readline().split()]


def I():
    return int(sys.stdin.buffer.readline())


def LS():
    return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n = I()
    h = LI()
    m = h[0] - 1
    for i in h[1:]:
        if m > i:
            print("No")
            return
        m = max(m, i - 1)
    print("Yes")
    return


# Solve
if __name__ == "__main__":
    solve()

+from itertools import permutations, accumulate -import random -    return [int(x) for x in sys.stdin.readline().split()] +    return [int(x) for x in sys.stdin.buffer.readline().split()] -    return int(sys.stdin.readline()) +    return int(sys.stdin.buffer.readline()) -# A -def A(): -    a, b, c = LI() -    c -= a - b -    print((max(0, c))) -    return -# B -def B(): -    n = I() -    ans = 0 -    for i in range(1, n + 1): -        s = str(i) -        if len(s) % 2: -            ans += 1 -    print(ans) -    return - - -# C -def C(): +def solve(): -    h[0] -= 1 -    for i in range(n - 1): -        if h[i + 1] < h[i]: +    m = h[0] - 1 +    for i in h[1:]: +        if m > i: -        if h[i + 1] > h[i]: -            h[i + 1] -= 1 +        m = max(m, i - 1) -    return - - -# D -def D(): -    return - - -# E -def E(): -    return - - -# F -def F(): -    C() +    solve()