Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

if N == 1:
    print("Yes")
elif H[0]-H[1] <= -1:
    H[1] -= 1
elif H[0]-H[1] == 0:
    H[0] -= 1
    H[1] -= 1
elif H[0]-H[1] == 1:
    H[0] -= 1
else:
    print("No")

if N >=　3:
    for i in range(1, N):
        if i == N-1:
            print("Yes")
            break
        elif H[i]-H[i+1] <= -1:
            H[i+1] -= 1
            continue
        elif H[i]-H[i+1] == 0:
            continue
        else:
            print("No")
            break


Fixed submission:
N = int(input())
H = list(map(int, input().split()))

if N == 1:
    print("Yes")

if N == 2:
    if H[0]-H[1] <= -1:
        print("Yes")
    else:
        print("No")

if N >= 3:
    for i in range(1, N):
        if H[0]-H[1] <= -1:
            H[1] -= 1
        elif H[0]-H[1] == 0:
            H[0] -= 1
            H[1] -= 1
        elif H[0]-H[1] == 1:
            H[0] -= 1

        if i == N-1:
            print("Yes")
            break
        elif H[i]-H[i+1] <= -1:
            H[i+1] -= 1
            continue
        elif H[i]-H[i+1] == 0:
            continue
        else:
            print("No")
            break

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

if H[0]-H[1] <= -1:
    H[1] -= 1
elif H[0]-H[1] == 0:
    H[0] -= 1
    H[1] -= 1
elif H[0]-H[1] == 1:
    H[0] -= 1
else:
    print("No")

for i in range(1, N):
    if i == N-1:
        print("Yes")
        break
    elif H[i]-H[i+1] <= -1:
        H[i+1] -= 1
        continue
    elif H[i]-H[i+1] == 0:
        continue
    else:
        print("No")
        break


Fixed submission:
N = int(input())
H = list(map(int, input().split()))

if N == 1:
    print("Yes")

if N == 2:
    if H[0]-H[1] <= -1:
        print("Yes")
    else:
        print("No")

if N >= 3:
    for i in range(1, N):
        if H[0]-H[1] <= -1:
            H[1] -= 1
        elif H[0]-H[1] == 0:
            H[0] -= 1
            H[1] -= 1
        elif H[0]-H[1] == 1:
            H[0] -= 1

        if i == N-1:
            print("Yes")
            break
        elif H[i]-H[i+1] <= -1:
            H[i+1] -= 1
            continue
        elif H[i]-H[i+1] == 0:
            continue
        else:
            print("No")
            break

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

if H[0]-H[1] <= -1:
    H[1] -= 1
elif H[0]-H[1] == 0:
    H[0] -= 1
    H[1] -= 1
elif H[0]-H[1] == 1:
    H[0] -= 1
else:
    print("No")

for i in range(1, N):
    if i == N-1:
        print("Yes")
        break
    elif H[i]-H[i+1] <= -1:
        H[i+1] -= 1
        continue
    elif H[i]-H[i+1] == 0:
        continue
    elif:
        print("No")
        break


Fixed submission:
N = int(input())
H = list(map(int, input().split()))

if N == 1:
    print("Yes")

if N == 2:
    if H[0]-H[1] <= -1:
        print("Yes")
    else:
        print("No")

if N >= 3:
    for i in range(1, N):
        if H[0]-H[1] <= -1:
            H[1] -= 1
        elif H[0]-H[1] == 0:
            H[0] -= 1
            H[1] -= 1
        elif H[0]-H[1] == 1:
            H[0] -= 1

        if i == N-1:
            print("Yes")
            break
        elif H[i]-H[i+1] <= -1:
            H[i+1] -= 1
            continue
        elif H[i]-H[i+1] == 0:
            continue
        else:
            print("No")
            break

Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

if H[0]-H[1] <= -1:
    H[1] -= 1
elif H[0]-H[1] = 0:
    H[0] -= 1
    H[1] -= 1
elif H[0]-H[1] = 1:
    H[0] -= 1
else:
    print("No")

for i in range(1, N):
    if i = N-1:
        print("Yes")
        break
    elif H[i]-H[i+1] <= -1:
        H[i+1] -= 1
        continue
    elif H[i]-H[i+1] = 0:
        continue
    elif:
        print("No")
        break


Fixed submission:
N = int(input())
H = list(map(int, input().split()))

if N == 1:
    print("Yes")

if N == 2:
    if H[0]-H[1] <= -1:
        print("Yes")
    else:
        print("No")

if N >= 3:
    for i in range(1, N):
        if H[0]-H[1] <= -1:
            H[1] -= 1
        elif H[0]-H[1] == 0:
            H[0] -= 1
            H[1] -= 1
        elif H[0]-H[1] == 1:
            H[0] -= 1

        if i == N-1:
            print("Yes")
            break
        elif H[i]-H[i+1] <= -1:
            H[i+1] -= 1
            continue
        elif H[i]-H[i+1] == 0:
            continue
        else:
            print("No")
            break