Buggy python submission (verdict: Runtime Error):
length = input()
a_list = list(map(int, input().split()))
 
for i in range(length):
  if i == (length - 1):
    break
  elif (a_list[i+1] - a_list[i]) >1 :
    a_list[i+1] += 1 
  elif a_list[i+1] >= 1 :
    continue
  elif a_list[i+1] < a_list[i]:
    print("No")
    break



Fixed submission:
length = input()
a_list = list(map(int, input().split()))
 
for i in range(len(a_list)-1):
  if a_list[i] < a_list[i+1]:
    a_list[i+1] -= 1
  elif a_list[i] > a_list[i+1]:
    print("No")
    exit()
    
print('Yes')

Buggy python submission (verdict: Runtime Error):
N = input()
H_list = list(map(int, input().split()))

for i in range(length):
  if i == (length - 1):
    break
  elif (list[i+1] - list[i]) >1 :
    list[i+1] += 1 
  elif list[i+1] >= 1 :
    continue
  elif list[i+1] < list[i]:
    print("No")
    break

Fixed submission:
length = input()
a_list = list(map(int, input().split()))
 
for i in range(len(a_list)-1):
  if a_list[i] < a_list[i+1]:
    a_list[i+1] -= 1
  elif a_list[i] > a_list[i+1]:
    print("No")
    exit()
    
print('Yes')

Buggy python submission (verdict: Runtime Error):
length = input()
list = list(map(int, input().split()))
 
for i in range(length):
  if i == (length - 1):
    print('Yes')
    break
  elif (list[i+1] - list[i]) >1 :
    list[i+1] += 1 
  elif list[i+1] >= 1 :
    continue
  elif list[i+1] < list[i]:
    print("No")
    break

Fixed submission:
length = input()
a_list = list(map(int, input().split()))
 
for i in range(len(a_list)-1):
  if a_list[i] < a_list[i+1]:
    a_list[i+1] -= 1
  elif a_list[i] > a_list[i+1]:
    print("No")
    exit()
    
print('Yes')

Buggy python submission (verdict: Runtime Error):
length = input()
list = list(map(int, input().split()))

for i in range(length):
  if i == (length - 1):
    print('Yes')
    break
  elif (list[i+1] - list[i]) >1 :
    list[i+1] += 1 
  elif list[i+1] >= 1 :
    continue
  elif list[i+1] < list[i]:
    print("No")
    break

Fixed submission:
length = input()
a_list = list(map(int, input().split()))
 
for i in range(len(a_list)-1):
  if a_list[i] < a_list[i+1]:
    a_list[i+1] -= 1
  elif a_list[i] > a_list[i+1]:
    print("No")
    exit()
    
print('Yes')

Buggy python submission (verdict: Runtime Error):
length = input()
list(map(int, input().split()))

for i in range(length):
  if i == length:
    print('Yes')
  elif list[i+1] - list[i] >1 :
    list[i+1] += 1 
  elif list[i+1] >= 1 :
    continue
  elif list[i+1] < list[i]:
    print("No")
    break

Fixed submission:
length = input()
a_list = list(map(int, input().split()))
 
for i in range(len(a_list)-1):
  if a_list[i] < a_list[i+1]:
    a_list[i+1] -= 1
  elif a_list[i] > a_list[i+1]:
    print("No")
    exit()
    
print('Yes')

Buggy python submission (verdict: Runtime Error):
length = int()
list = int().split()

for i in range(length):
  if i == length:
    print('Yes')
  elif list[i+1] - list[i] >1 :
    list[i+1] += 1 
  elif list[i+1] >= 1 :
    continue
  elif list[i+1] < list[i]:
    print("No")
    break




Fixed submission:
length = input()
a_list = list(map(int, input().split()))
 
for i in range(len(a_list)-1):
  if a_list[i] < a_list[i+1]:
    a_list[i+1] -= 1
  elif a_list[i] > a_list[i+1]:
    print("No")
    exit()
    
print('Yes')