Buggy python submission (verdict: Runtime Error):
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N == 1:
  coment = 'Yes'
  
elif N == 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      for j in range(N-2-i):
        if num[i+2+j] - num[i+1] < 0:
          coment = 'No'
          break
		elif num[i+2+j] - num[i+1] > 0:
          break
          
print(coment)

Fixed submission:
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N == 1:
  coment = 'Yes'
  
elif N == 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      for j in range(N-2-i):
        if num[i+2+j] - num[i+1] < 0:
          coment = 'No'
          break
        elif num[i+2+j] - num[i+1] > 0:
          break
          
print(coment)

Buggy python submission (verdict: Runtime Error):
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N == 1:
  coment = 'Yes'
  
elif N == 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      for j in range(N-2-i):
        if num[i+2+j] - num[i+1] < 0:
          coment = 'No'
          break
		elif num[i+2+j] - num[i+1] > 0:
          break
          
print(coment)

Fixed submission:
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N == 1:
  coment = 'Yes'
  
elif N == 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      for j in range(N-2-i):
        if num[i+2+j] - num[i+1] < 0:
          coment = 'No'
          break
        elif num[i+2+j] - num[i+1] > 0:
          break
          
print(coment)

Buggy python submission (verdict: Runtime Error):
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N = 1:
  coment = 'Yes'
  
elif N = 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      if num[i+2] - num[i+1] < 0:
        coment = 'No'
        break

print(coment)

Fixed submission:
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N == 1:
  coment = 'Yes'
  
elif N == 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      for j in range(N-2-i):
        if num[i+2+j] - num[i+1] < 0:
          coment = 'No'
          break
        elif num[i+2+j] - num[i+1] > 0:
          break
          
print(coment)

Buggy python submission (verdict: Runtime Error):
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N = 1:
  coment = 'Yes'
  
elif N = 2:
  if num[0] - num[1] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i] - num[i+1] < -1:
      coment = 'No'
      break
    elif num[i] - num[i+1] < 0:
      if num[i+1] - num[i+2] < 0:
        coment = 'No'
        break

print(coment)
      

Fixed submission:
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N == 1:
  coment = 'Yes'
  
elif N == 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      for j in range(N-2-i):
        if num[i+2+j] - num[i+1] < 0:
          coment = 'No'
          break
        elif num[i+2+j] - num[i+1] > 0:
          break
          
print(coment)

Buggy python submission (verdict: Runtime Error):
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

for i in range(N):
  if num[i] - num[i+1] < -1:
    coment = 'No'
    break
  elif num[i] - num[i+1] < 0:
    if num[i+1] - num[i+2] < 0:
      coment = 'No'
      break

print(coment)
      

Fixed submission:
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N == 1:
  coment = 'Yes'
  
elif N == 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      for j in range(N-2-i):
        if num[i+2+j] - num[i+1] < 0:
          coment = 'No'
          break
        elif num[i+2+j] - num[i+1] > 0:
          break
          
print(coment)