Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        h[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1) :
    for k in range(i+1, N):
        if H[i] - H[k] > 1 :
            print('No')
            ans = 1
            exit()
if ans == 0:
    print('Yes')


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if h[i] < h[i+1] :
        h[i+1] -= 1
    elif h[i] > h[i+1]:
        print('No')
        exit()
print('Yes')


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1) :
    for k in range(i+1, N):
        if s[i] - s[k] > 1 :
            print('No')
            ans = 1
            exit()
if ans == 0:
    print('Yes')


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1) :
    for k in range(i+1, N):
        if s[i] - s[k] > 1 :
            print('No')
            ans = 1
            break
    else:
        continue
    break
if ans == 0:
    print('Yes')


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1) :
    for k in range(i+1, N):
        if s[i] - s[k] > 1 :
            print('No')
            ans = 1
            break
if ans == 0:
    print('Yes')


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))
for i in range(N-1) :
    for k in range(i+1, N):
        if s[i] - s[k] > 1 :
            print('No')
            break
        else:
            print('Yes')


Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
for i in range(N - 1):
    if H[i] < H[i+1] :
        H[i+1] -= 1

    elif H[i] > H[i+1]:
        print('No')
        exit()

print('Yes')