Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline

n = int(input())
L = np.array(list(map(int, input().split())))
s = 0
f = True
while True:
    minL = np.min(L[s:])
    m_idx = np.where(L==minL)[0][-1]
    for i in range(s, m_idx):
        if L[i] - minL >=2:
            print('No')
            f = False
            break
    s = m_idx+1
    
    if s==n or f ==False:
        break

if f ==True:
    print('Yes')


Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
input = sys.stdin.readline

n = int(input())
L = np.array(list(map(int, input().split())))
s = 0
f = True
while True:
    minL = np.min(L[s:])
    m_idx = np.where(L==minL)[0][-1]
    for i in range(s, m_idx):
        if L[i] - minL >=2:
            print('No')
            f = False
            break
    s = m_idx+1
    
    if s==n or f ==False:
        break

if f ==True:
    print('Yes')

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n = int(input())
L = list(map(int, input().split()))
f =True
for i in range(n):
    if L[i] -min(L[i:])>=2:
        print('No')
        f = False
        break
if f==True:
    print('Yes')

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
input = sys.stdin.readline

n = int(input())
L = np.array(list(map(int, input().split())))
s = 0
while True:
    minL = np.min(L[s:])
    m_idx = np.where(L==minL)[0][-1]
    for i in range(s, m_idx):
        if L[i] - minL ==1:
            L[i]-=1
    s = m_idx+1
    
    if s==n:
        break

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n = int(input())
hL = list(map(int, input().split()))
 
for i in range(n):
    if hL[i] - min(hL[i:n])==1:
        hL[i]-=1
if hL ==sorted(hL):
    print('Yes')
else:
    print('No')

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n = int(input())
hL = list(map(int, input().split()))

for i in range(n):
    if hL[i] - min(hL[i:n])==1:
        hL[i]-=1
if hL ==sorted(hL):
    print('Yes')
else:
    print('No')

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = sys.stdin.readline
n = int(input())
hL = list(map(int, input().split()))
flag = 'Yes'
for i in range(n-1):
    for j in range(i+1, n) :
        if hL[i] -hL[j]>=2:
            flag = 'No'
            break
    if flag =='No':
        break
print(flag)

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n = int(input())
hL = list(map(int, input().split()))

for i in range(n):
    if hL[i] !=min(hL[i:n]):
        hL[i]-=1
if hL ==sorted(hL):
    print('Yes')
else:
    print('No')

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = sys.stdin.readline
n = int(input())
hL = list(map(int, input().split()))
flag = 'Yes'
for i in range(n-1):
    for j in range(i+1, n) :
        if hL[i] -hL[j]>=2:
            flag = 'No'
            break
    if flag =='No':
        break
print(flag)

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = sys.stdin.readline
n = int(input())
hL = list(map(int, input().split()))
for i in range(n-1):
    for j in range(i+1, n) :
        if hL[i] >hL[j]:
            hL[i]-=1
            break
if hL ==sorted(hL):
    print('Yes')
else:
    print('No')

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = sys.stdin.readline
n = int(input())
hL = deque(list(map(int, input().split())))
for i in range(n-1):
    for j in range(i+1, n) :
        if hL[i] >hL[j]:
            hL[i]-=1
            break
if list(hL) ==sorted(hL):
    print('Yes')
else:
    print('No')

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline
n = int(input())

L = np.array(list(map(int, input().split())))

for i in range(n-1, 0, -1):
    if L[i]-L[i-1] ==-1:
        L[i-1] -=1

if np.all(L ==sorted(L)):
    print('Yes')
else:
    print('No')