Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

if m != 0:
    lin = [int(stdin.readline().rstrip()) for _ in range(m)]
else:
    lin = [-1]

dp = [-1]*(n+1)
dp[0] = 1

if lin[0] == 1:
    dp[1] = 0
else:
    dp[1] = 1

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

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

Fixed submission:
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

lin = [0]*(n+1)

if m != 0:
    for i in range(m):
        lin[int(stdin.readline().rstrip())] = -1

dp = [-1]*(n+1)

dp[0] = 1

if lin[1] == -1:
    dp[1] = 0
else:
    dp[1] = 1

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

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

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

if m != 0:
    lin = [int(stdin.readline().rstrip()) for _ in range(m)]
else:
    lin = [-1]

dp = [-1 for _ in range(n+1)]
dp[0] = 1

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

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

Fixed submission:
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

lin = [0]*(n+1)

if m != 0:
    for i in range(m):
        lin[int(stdin.readline().rstrip())] = -1

dp = [-1]*(n+1)

dp[0] = 1

if lin[1] == -1:
    dp[1] = 0
else:
    dp[1] = 1

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

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

Buggy python submission (verdict: Runtime Error):
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]
lin = [int(stdin.readline().rstrip()) for _ in range(m)]

for i in range(len(lin)-1):
    if lin[i] + 1 == lin[i+1]:
        print(0)
        exit()

dp = [-1 for _ in range(n+1)]
dp[0] = 1
if lin[0] == 1:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(2,n+1):
    if i in lin:
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]

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

Fixed submission:
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

lin = [0]*(n+1)

if m != 0:
    for i in range(m):
        lin[int(stdin.readline().rstrip())] = -1

dp = [-1]*(n+1)

dp[0] = 1

if lin[1] == -1:
    dp[1] = 0
else:
    dp[1] = 1

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

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

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import accumulate

a,b = [int(x) for x in stdin.readline().rstrip().split()]
li = [int(stdin.readline().rstrip()) for _ in range(b)]

if a == 1:
    print(1)
    exit()

elif a == 2:
    if b == 0:
        print(2)
        exit()
    else:
        print(1) 
        exit()

for k in range(len(li)-1):
    if li[k] +1 == li[k+1]:
        print(0)
        exit()

def stair_cal(x):
    if x == 1:
        return(x)
    elif x == 2:
        return(x)
    elif x == 0:
        return(1)
    lin = [1,2]
    for i in range(2,x):
        lin.append(lin[i-2]+lin[i-1])
    return(lin[-1])

li2 = []

li2.append(li[0]-1)

for i in range(1,b):
    li2.append(li[i]-li[i-1]-1)

li2.append(a-li[-1])

point = 1

for e in range(len(li2)):
    point = point*stair_cal(li2[e])%(10**9+7)

print(point)


Fixed submission:
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

lin = [0]*(n+1)

if m != 0:
    for i in range(m):
        lin[int(stdin.readline().rstrip())] = -1

dp = [-1]*(n+1)

dp[0] = 1

if lin[1] == -1:
    dp[1] = 0
else:
    dp[1] = 1

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

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

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import accumulate

a,b = [int(x) for x in stdin.readline().rstrip().split()]
li = [int(stdin.readline().rstrip()) for _ in range(b)]

if a == 1:
    print(1)
    exit()

elif a == 2:
    if b == 0:
        print(0)
        exit()
    else:
        print(1) 
        exit()

for k in range(len(li)-1):
    if li[k] +1 == li[k+1]:
        print(0)
        exit()

def stair_cal(x):
    if x == 1:
        return(x)
    elif x == 2:
        return(x)
    elif x == 0:
        return(1)
    lin = [1,2]
    for i in range(2,x):
        lin.append(lin[i-2]+lin[i-1])
    return(lin[-1])

li2 = []

li2.append(li[0]-1)

for i in range(1,b):
    li2.append(li[i]-li[i-1]-1)

li2.append(a-li[-1])

point = 1

for e in range(len(li2)):
    point = point*stair_cal(li2[e])%(10**9+7)

print(point)

Fixed submission:
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

lin = [0]*(n+1)

if m != 0:
    for i in range(m):
        lin[int(stdin.readline().rstrip())] = -1

dp = [-1]*(n+1)

dp[0] = 1

if lin[1] == -1:
    dp[1] = 0
else:
    dp[1] = 1

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

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