#from:#7967379

N = int(eval(input()))

W = list(map(int, input().split()))

judge = True



for i in range(N-1):

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

    W[i+1]-=1

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

    judge = False

    break

print(('Yes' if judge else 'No'))



'''

in [1]:

  4

  4 3 5 6

out [1]:

  No

'''
N = int(eval(input()))

H = list(map(int, input().split()))



Frg = True #True => 'Yes'



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

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

    H[i-1] -= 1

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

      Frg = False

      break



print(('Yes' if Frg else 'No'))
# from:#7967379
N = int(eval(input()))
W = list(map(int, input().split()))
judge = True
for i in range(N - 1):
    if W[i] < W[i + 1]:
        W[i + 1] -= 1
    if W[i] > W[i + 1]:
        judge = False
        break
print(("Yes" if judge else "No"))
"""
in [1]:
  4
  4 3 5 6
out [1]:
  No
"""

N = int(eval(input()))
H = list(map(int, input().split()))
Frg = True  # True => 'Yes'
for i in range(N - 1, 1, -1):
    if H[i - 1] > H[i]:
        H[i - 1] -= 1
        if H[i - 1] > H[i]:
            Frg = False
            break
print(("Yes" if Frg else "No"))

-# from:#7967379 -W = list(map(int, input().split())) -judge = True -for i in range(N - 1): -    if W[i] < W[i + 1]: -        W[i + 1] -= 1 -    if W[i] > W[i + 1]: -        judge = False -        break -print(("Yes" if judge else "No")) -""" -in [1]: -  4 -  4 3 5 6 -out [1]: -  No -""" +H = list(map(int, input().split())) +Frg = True  # True => 'Yes' +for i in range(N - 1, 1, -1): +    if H[i - 1] > H[i]: +        H[i - 1] -= 1 +        if H[i - 1] > H[i]: +            Frg = False +            break +print(("Yes" if Frg else "No"))