Buggy python submission (verdict: Runtime Error):
import sys

n = int(input())
h = list(map(int, input().split()))

for i in range(n):
    d = h[i+1] - h[i]
    if d >= 1:
        h[i+1] -= 1
    elif d < 0:
        print('No')
        sys.exit()
print('Yes')


Fixed submission:
import sys

n = int(input())
h = list(map(int, input().split()))

for i in range(n-1):
    d = h[i+1] - h[i]
    if d >= 1:
        h[i+1] -= 1
    elif d < 0:
        print('No')
        sys.exit()
print('Yes')

Buggy python submission (verdict: Runtime Error):
import numpy as np
flag = False

N = int(input())
H = list(map(int, input().split()))
H = np.array(H)
D = (H[1:]-H[:-1])

for i in range(len(H[1:]-H[:-1])):
    if D[i] < -1:
        flag = True
        break
    elif D[i] == -1:
        if i-1 < 0:
            continue
        elif i+1 == len(D):
            continue
        else:
            if len(D[D[i+1] == -1]) >= 1:
                flag = True
                break
            elif len(D[D[i-1] == -1]) >= 1:
                flag = True
                break

if flag == True:
    print('No')
else:
    print('Yes')


Fixed submission:
import sys

n = int(input())
h = list(map(int, input().split()))

for i in range(n-1):
    d = h[i+1] - h[i]
    if d >= 1:
        h[i+1] -= 1
    elif d < 0:
        print('No')
        sys.exit()
print('Yes')

Buggy python submission (verdict: Runtime Error):
import numpy as np
flag = False

N = int(input())
H = list(map(int, input().split()))
H = np.array(H)
D = (H[1:]-H[:-1])

for i in range(len(H[1:]-H[:-1])):
    if D[i] < -1:
        flag = True
        break
    elif D[i] == -1:
        if i-1 < 0:
            continue
        elif i+1 == len(D):
            continue
        else:
            if len(D[D[i+1] == -1]) >= 1:
                flag = True
                break
            if len(D[D[i-1] == -1]) >= 1:
                flag = True
                break

if flag == True:
    print('No')
else:
    print('Yes')


Fixed submission:
import sys

n = int(input())
h = list(map(int, input().split()))

for i in range(n-1):
    d = h[i+1] - h[i]
    if d >= 1:
        h[i+1] -= 1
    elif d < 0:
        print('No')
        sys.exit()
print('Yes')

Buggy python submission (verdict: Runtime Error):
import numpy as np
flag = False

N = int(input())
H = list(map(int, input().split()))
H = np.array(H)
D = (H[1:]-H[:-1])

for i in range(len(H[1:]-H[:-1])):
    if D[i] < -1:
        flag = True
        break
    elif D[i] == -1:
        if D[i-1] == -1:
            flag = True
            break
        elif D[i+1] == -1:
            flag = True
            break

if flag == True:
    print('No')
else:
    print('Yes')


Fixed submission:
import sys

n = int(input())
h = list(map(int, input().split()))

for i in range(n-1):
    d = h[i+1] - h[i]
    if d >= 1:
        h[i+1] -= 1
    elif d < 0:
        print('No')
        sys.exit()
print('Yes')

Buggy python submission (verdict: Runtime Error):
import numpy as np
flag = False

N = int(input())
H = list(map(int, input().split()))
H = np.array(H)
D = (H[1:]-H[:-1])

for i in range(len(H[1:]-H[:-1])):
    if D[i] < -1:
        flag = True
        break
    elif D[i] == -1:
        if D[i-1] == -1:
            flag = True
        elif D[i+1] == -1:
            flag = True

if flag == True:
    print('No')
else:
    print('Yes')


Fixed submission:
import sys

n = int(input())
h = list(map(int, input().split()))

for i in range(n-1):
    d = h[i+1] - h[i]
    if d >= 1:
        h[i+1] -= 1
    elif d < 0:
        print('No')
        sys.exit()
print('Yes')