Buggy python submission (verdict: Runtime Error):
INF = float("inf") #const

def main():
    n,m = map(int,input().split())
    issafe = [0]*m
    for i in range(m):
        a = int(input())
        issafe[a] = False
    dp = [0]*(n+1)
    dp[0],dp[1] = 1,1

    for i in range(2,n+1):
        if issafe[i-1]:
            dp[i] += dp[i-1]
        if issafe[i-2]:
            dp[i] += dp[i-2]

    print(dp[n]%(10**9+7))


if __name__ == "__main__":
    main()


Fixed submission:
INF = float("inf") #const

def main():
    n,m = map(int,input().split())
    issafe = [True]*n
    for i in range(m):
        a = int(input())
        issafe[a] = False
    dp = [0]*(n+1)
    dp[0],dp[1] = 1,1

    for i in range(2,n+1):
        if issafe[i-1]:
            dp[i] += dp[i-1]
        if issafe[i-2]:
            dp[i] += dp[i-2]

    print(dp[n]%(10**9+7))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
INF = float("inf") #const

def main():
    n,m = map(int,input().split())
    a = [int(input()) for i in range(m)]
    dp = [0]*(n+1)
    dp[0],dp[1] = 1,1

    for i in range(2,n+1):
        if issafe(i-1,a):
            dp[i] += dp[i-1]
        if issafe(i-2,a):
            dp[i] += dp[i-2]

    print(dp[n]%(10**9+7))


def issafe(i,a):
    if i in a:
        return False
    else:
        return True


if __name__ == "__main__":
    main()


Fixed submission:
INF = float("inf") #const

def main():
    n,m = map(int,input().split())
    issafe = [True]*n
    for i in range(m):
        a = int(input())
        issafe[a] = False
    dp = [0]*(n+1)
    dp[0],dp[1] = 1,1

    for i in range(2,n+1):
        if issafe[i-1]:
            dp[i] += dp[i-1]
        if issafe[i-2]:
            dp[i] += dp[i-2]

    print(dp[n]%(10**9+7))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
INF = float("inf") #const

def main():
    n,m = map(int,input().split())
    a = [int(input()) for i in range(m)]
    dp = [0]*(n+1)
    dp[0],dp[1] = 1,1

    for i in range(2,n+1):
        if issafe(i-1,a):
            dp[i] += dp[i-1]
        if issafe(i-2,a):
            dp[i] += dp[i-2]

    print(dp[n]%(10**9+7))


def issafe(i,a):
    if i in a:
        return False
    else:
        return True


if __name__ == "__main__":
    main()


Fixed submission:
INF = float("inf") #const

def main():
    n,m = map(int,input().split())
    issafe = [True]*n
    for i in range(m):
        a = int(input())
        issafe[a] = False
    dp = [0]*(n+1)
    dp[0],dp[1] = 1,1

    for i in range(2,n+1):
        if issafe[i-1]:
            dp[i] += dp[i-1]
        if issafe[i-2]:
            dp[i] += dp[i-2]

    print(dp[n]%(10**9+7))


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10000*10000)

INF = float("inf") #const

def main():
    n,m = map(int,input().split())
    a = [int(input()) for i in range(m)]
    dp = [0]*(n+1)
    dp[0],dp[1] = 1,1

    for i in range(2,n+1):
        if issafe(i-1,a):
            dp[i] += dp[i-1]
        if issafe(i-2,a):
            dp[i] += dp[i-2]

    print(dp[n]%(10**9+7))


def issafe(i,a):
    if i in a:
        return False
    else:
        return True


if __name__ == "__main__":
    main()


Fixed submission:
INF = float("inf") #const

def main():
    n,m = map(int,input().split())
    issafe = [True]*n
    for i in range(m):
        a = int(input())
        issafe[a] = False
    dp = [0]*(n+1)
    dp[0],dp[1] = 1,1

    for i in range(2,n+1):
        if issafe[i-1]:
            dp[i] += dp[i-1]
        if issafe[i-2]:
            dp[i] += dp[i-2]

    print(dp[n]%(10**9+7))


if __name__ == "__main__":
    main()