#

# 　　  ⋀_⋀　 

#　　  (･ω･)  

# .／ Ｕ ∽ Ｕ＼

#  │＊　合　＊│

#  │＊　格　＊│ 

#  │＊　祈　＊│ 

#  │＊　願　＊│ 

#  │＊　　　＊│ 

#      ￣

#

import sys

input=sys.stdin.readline

from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ

from heapq import heappop, heappush, heappushpop

from collections import Counter,defaultdict

from itertools import accumulate,permutations,combinations,product,combinations_with_replacement

from bisect import bisect_left,bisect_right

inf=float('inf')

mod = 10**9+7

def INT_(n): return int(n)-1

def MI(): return list(map(int,input().split()))

def MF(): return list(map(float, input().split()))

def MI_(): return list(map(INT_,input().split()))

def LI(): return list(MI())

def LI_(): return [int(x) - 1 for x in input().split()]

def LF(): return list(MF())

def LIN(n:int): return [I() for _ in range(n)]

def LLIN(n: int): return [LI() for _ in range(n)]

def LLIN_(n: int): return [LI_() for _ in range(n)]

def LLI(): return [list(map(int, l.split() )) for l in eval(input())]

def I(): return int(eval(input()))

def F(): return float(eval(input()))

def ST(): return input().replace('\n', '')

def main():

    N=I()

    H=LI()[::-1]

    for i,h in enumerate(H):

        if i == 0:

            pass

        else:

            if h <= H[i-1]:

                continue

            else:

                H[i]-=1

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

                    print("No")

                    exit()

            



    print("Yes")

        

if __name__ == '__main__':

    main()
#

# 　　  ⋀_⋀　 

#　　  (･ω･)  

# .／ Ｕ ∽ Ｕ＼

#  │＊　合　＊│

#  │＊　格　＊│ 

#  │＊　祈　＊│ 

#  │＊　願　＊│ 

#  │＊　　　＊│ 

#      ￣

#

import sys

sys.setrecursionlimit(10**6)

input=sys.stdin.readline

from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ

from heapq import heappop, heappush, heappushpop

from collections import Counter,defaultdict,deque

from itertools import accumulate,permutations,combinations,product,combinations_with_replacement

from bisect import bisect_left,bisect_right

from copy import deepcopy

from fractions import gcd

from random import randint

def ceil(a,b): return (a+b-1)//b

inf=float('inf')

mod = 10**9+7

def pprint(*A): 

    for a in A:     print(*a,sep='\n')

def INT_(n): return int(n)-1

def MI(): return map(int,input().split())

def MF(): return map(float, input().split())

def MI_(): return map(INT_,input().split())

def LI(): return list(MI())

def LI_(): return [int(x) - 1 for x in input().split()]

def LF(): return list(MF())

def LIN(n:int): return [I() for _ in range(n)]

def LLIN(n: int): return [LI() for _ in range(n)]

def LLIN_(n: int): return [LI_() for _ in range(n)]

def LLI(): return [list(map(int, l.split() )) for l in input()]

def I(): return int(input())

def F(): return float(input())

def ST(): return input().replace('\n', '')

def main():

    N = I()

    H=LI()

    now = 0

    for h in H:

        if now > h:

            print("No")

            return

        now = max(now, h-1)

    print("Yes")

if __name__ == '__main__':

    main()

#
# 　　  ⋀_⋀
# 　　  (･ω･)
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│
#  │＊　祈　＊│
#  │＊　願　＊│
#  │＊　　　＊│
#      ￣
#
import sys

input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log  # log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict
from itertools import (
    accumulate,
    permutations,
    combinations,
    product,
    combinations_with_replacement,
)
from bisect import bisect_left, bisect_right

inf = float("inf")
mod = 10**9 + 7


def INT_(n):
    return int(n) - 1


def MI():
    return list(map(int, input().split()))


def MF():
    return list(map(float, input().split()))


def MI_():
    return list(map(INT_, input().split()))


def LI():
    return list(MI())


def LI_():
    return [int(x) - 1 for x in input().split()]


def LF():
    return list(MF())


def LIN(n: int):
    return [I() for _ in range(n)]


def LLIN(n: int):
    return [LI() for _ in range(n)]


def LLIN_(n: int):
    return [LI_() for _ in range(n)]


def LLI():
    return [list(map(int, l.split())) for l in eval(input())]


def I():
    return int(eval(input()))


def F():
    return float(eval(input()))


def ST():
    return input().replace("\n", "")


def main():
    N = I()
    H = LI()[::-1]
    for i, h in enumerate(H):
        if i == 0:
            pass
        else:
            if h <= H[i - 1]:
                continue
            else:
                H[i] -= 1
                if H[i] > H[i - 1]:
                    print("No")
                    exit()
    print("Yes")


if __name__ == "__main__":
    main()

#
# 　　  ⋀_⋀
# 　　  (･ω･)
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│
#  │＊　祈　＊│
#  │＊　願　＊│
#  │＊　　　＊│
#      ￣
#
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.readline
from math import floor, sqrt, factorial, hypot, log  # log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict, deque
from itertools import (
    accumulate,
    permutations,
    combinations,
    product,
    combinations_with_replacement,
)
from bisect import bisect_left, bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint


def ceil(a, b):
    return (a + b - 1) // b


inf = float("inf")
mod = 10**9 + 7


def pprint(*A):
    for a in A:
        print(*a, sep="\n")


def INT_(n):
    return int(n) - 1


def MI():
    return map(int, input().split())


def MF():
    return map(float, input().split())


def MI_():
    return map(INT_, input().split())


def LI():
    return list(MI())


def LI_():
    return [int(x) - 1 for x in input().split()]


def LF():
    return list(MF())


def LIN(n: int):
    return [I() for _ in range(n)]


def LLIN(n: int):
    return [LI() for _ in range(n)]


def LLIN_(n: int):
    return [LI_() for _ in range(n)]


def LLI():
    return [list(map(int, l.split())) for l in input()]


def I():
    return int(input())


def F():
    return float(input())


def ST():
    return input().replace("\n", "")


def main():
    N = I()
    H = LI()
    now = 0
    for h in H:
        if now > h:
            print("No")
            return
        now = max(now, h - 1)
    print("Yes")


if __name__ == "__main__":
    main()

+sys.setrecursionlimit(10**6) -from math import floor, ceil, sqrt, factorial, log  # log2ないｙｐ +from math import floor, sqrt, factorial, hypot, log  # log2ないｙｐ -from collections import Counter, defaultdict +from collections import Counter, defaultdict, deque +from copy import deepcopy +from fractions import gcd +from random import randint + + +def ceil(a, b): +    return (a + b - 1) // b + + + +def pprint(*A): +    for a in A: +        print(*a, sep="\n") -    return list(map(int, input().split())) +    return map(int, input().split()) -    return list(map(float, input().split())) +    return map(float, input().split()) -    return list(map(INT_, input().split())) +    return map(INT_, input().split()) -    return [list(map(int, l.split())) for l in eval(input())] +    return [list(map(int, l.split())) for l in input()] -    return int(eval(input())) +    return int(input()) -    return float(eval(input())) +    return float(input()) -    H = LI()[::-1] -    for i, h in enumerate(H): -        if i == 0: -            pass -        else: -            if h <= H[i - 1]: -                continue -            else: -                H[i] -= 1 -                if H[i] > H[i - 1]: -                    print("No") -                    exit() +    H = LI() +    now = 0 +    for h in H: +        if now > h: +            print("No") +            return +        now = max(now, h - 1)