Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  else:
    continue
for k in range(n-1):
  if h[k] > h[k+1] and h[k+1] > h[k+2]:
    print("No")
    exit()
  else:
    continue
print("Yes")


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  else:
    h[j] = h[j] -1
  if h[j] > h[j+1]:
    print("No")
    exit()
print("Yes")


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n):
  if h[j] - h[j+1] < -1:
    print("No")
    exit()
  else:
    h[j+1] = h[j+1] -1
  if h[j] < h[j+1]:
    print("No")
    exit()
print("Yes")


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n):
  if h[j] - h[j+1] < -1:
    print("No")
    exit()
  else:
    continue
for k in range(n-1):
  if h[k] < h[k+1] and h[k+1] < h[k+2]:
    print("No")
    exit()
  else:
    continue
print("Yes")


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] < -1:
    print("No")
    exit()
  else:
    continue
for k in range(n-2):
  if  h[k] < h[k+1] and h[k+1] < h[k+2]:
     print("No")
    exit()
  else:
    continue
print("Yes")


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
if h[j] - h[j+1] < -1 for j in range(n):
  print("No")
elif h[k+2] > h[k+1] and h[k+1] <= h[k] for k in range(n-1):
  print("No")
else:
  print("Yes")


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
if h[j+1] - h[j] < -1 for j in range(n):
  print("No")
elif h[k+2] < h[k+1] and h[k+1] <= h[k] for k in range(n-1):
  print("No")
else:
  print("Yes")


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for in in input().split()]
if h[j+1] - h[j] < -1 for j in range(n):
  print("No")
elif h[k+2] < h[k+1] and h[k+1] <= h[k] for k in range(n-1):
  print("No")
else:
  print("Yes")


Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")