Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=[int(input()) for i in range(M)]
dp=[1]*(N+2)
dp[1]=0 if a[0]==1 else 1
for i in a:
    dp[i]=0
for i in range(1,N):
    if dp[i+1]!=0:
        dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
print(dp[N])

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    if M!=0:
        dp[1]=0 if a[0]==1 else 1
        for i in a:
            dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+2)
    dp[1]=0 if a[0]==1 else 1
    for i in a:
        dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()


Fixed submission:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    if M!=0:
        dp[1]=0 if a[0]==1 else 1
        for i in a:
            dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    dp[1]=0 if a[0]==1 else 1
    for i in a:
        dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()


Fixed submission:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    if M!=0:
        dp[1]=0 if a[0]==1 else 1
        for i in a:
            dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    dp[1]=0 if a[0]==1 else 1
    for i in a:
        dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()


Fixed submission:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    if M!=0:
        dp[1]=0 if a[0]==1 else 1
        for i in a:
            dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    dp[1]=0 if a[0]==1 else 1
    for i in a:
        dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1]=dp[i]+dp[i-1]
    print(dp[N]%1000000007)


if __name__ == '__main__':
    main()

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    a=[int(input()) for i in range(M)]
    dp=[1]*(N+1)
    if M!=0:
        dp[1]=0 if a[0]==1 else 1
        for i in a:
            dp[i]=0
    for i in range(1,N):
        if dp[i+1]!=0:
            dp[i+1] = (dp[i]+dp[i-1]) % 1000000007
    print(dp[N])


if __name__ == '__main__':
    main()