Buggy python submission (verdict: Runtime Error):
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
count = N - 1
while count >= 0:
    if li[count] - li[count-1] => 0:
        pass
    elif li[count] - li[count-1] == -1:
        li[count-1] -= 1
    else:
        ans = "No"
        break
    count -= 1
print(ans)

Fixed submission:
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
count = N - 1
while count >= 1:
    if li[count] - li[count-1] >= 0:
        pass
    elif li[count] - li[count-1] == -1:
        li[count-1] -= 1
    else:
        ans = "No"
        break
    count -= 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
count = N - 1
while count >= 0:
    if li[count] - li[count-1] => 0:
        pass
    elif li[count] - li[count-1] = -1:
        li[count-1] -= 1
    else:
        ans = "No"
        break
    count -= 1
print(ans)

Fixed submission:
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
count = N - 1
while count >= 1:
    if li[count] - li[count-1] >= 0:
        pass
    elif li[count] - li[count-1] == -1:
        li[count-1] -= 1
    else:
        ans = "No"
        break
    count -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
count = N - 1
while count >= 0:
    if li[count] - li[count-1] < -1:
        ans = "No"
        break
    elif li[count] - li[count-1] == -1:
        if count == 1:
            ans = "No"
            break
        else:
            tmp = count -2
            while tmp >= 0:
                if li[count] - li[tmp] <= -2:
                    ans = "No"
                    break
                elif li[count] >= li[tmp]:
                    count = tmp
                    break
                tmp -= 1
            if ans == "No":
                break
            count -= 1
print(ans)

Fixed submission:
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
count = N - 1
while count >= 1:
    if li[count] - li[count-1] >= 0:
        pass
    elif li[count] - li[count-1] == -1:
        li[count-1] -= 1
    else:
        ans = "No"
        break
    count -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
for i in range(1, N):
    if li[i] - li[i-1] < -1:
        ans = "No"
        break
    elif li[i] - li[i-1] == -1:
        if i != 1:
            tmp = i -2
            while tmp >= 0:
                if li[i] - li[tmp] <= -2:
                    ans = "No"
                    break
                tmp -= 1
            if ans == "No":
                break
print(ans)

Fixed submission:
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
count = N - 1
while count >= 1:
    if li[count] - li[count-1] >= 0:
        pass
    elif li[count] - li[count-1] == -1:
        li[count-1] -= 1
    else:
        ans = "No"
        break
    count -= 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
for i in range(1, N):
    if li[i] - li[i-1] < -1:
        ans = "No"
        break
    elif li[i] - li[i-1] == -1:
        if i != 1:
            tmp = i -2
            while tmp >= 0:
                if li[i] - li[tmp] <= -2:
                    ans = "No"
                    break
                tmp -= 1
print(ans)

Fixed submission:
N = int(input())
li = list(map(int, input().split()))
ans = "Yes"
count = N - 1
while count >= 1:
    if li[count] - li[count-1] >= 0:
        pass
    elif li[count] - li[count-1] == -1:
        li[count-1] -= 1
    else:
        ans = "No"
        break
    count -= 1
print(ans)