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

n, m = map(int, sys.stdin.readline().split())
A = [int(sys.stdin.readline()) for _ in range(m)]

dp = [0 for i in range(n+1)]
dp[0] =1
#print(dp)

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


print(dp[-1]%1000000007)


Fixed submission:
import sys

n, m = map(int, sys.stdin.readline().split())
A = [int(sys.stdin.readline()) for _ in range(m)]
bloken = [0 for i in range(n+1)]
for a in A:
    bloken[a]=1
    

dp = [0 for i in range(n+1)]
dp[0] =1
#print(dp)

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


print(dp[-1]%1000000007)

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

n, m = map(int, sys.stdin.readline().split())
A = [int(sys.stdin.readline()) for _ in range(m)]

dp = [0 for i in range(n+1)]
dp[0] =1
#print(dp)

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


print(dp[-1]%1000000007)

Fixed submission:
import sys

n, m = map(int, sys.stdin.readline().split())
A = [int(sys.stdin.readline()) for _ in range(m)]
bloken = [0 for i in range(n+1)]
for a in A:
    bloken[a]=1
    

dp = [0 for i in range(n+1)]
dp[0] =1
#print(dp)

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


print(dp[-1]%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10000000)
n, m = map(int, sys.stdin.readline().split())
A = [int(sys.stdin.readline()) for _ in range(m)]

cnt=0
def calc(d):
    if d >=n:
        if d ==n:
            global cnt
            cnt+=1
        return
    if d in A:
        return
    else:
        calc(d+1)
        calc(d+2)



calc(0)
print(cnt%1000000007)

Fixed submission:
import sys

n, m = map(int, sys.stdin.readline().split())
A = [int(sys.stdin.readline()) for _ in range(m)]
bloken = [0 for i in range(n+1)]
for a in A:
    bloken[a]=1
    

dp = [0 for i in range(n+1)]
dp[0] =1
#print(dp)

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


print(dp[-1]%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10000000)
n, m = map(int, sys.stdin.readline().split())
A = [int(sys.stdin.readline()) for _ in range(m)]

cnt=0
def calc(d):
    if d >=n:
        if d ==n:
            global cnt
            cnt+=1
        return
    if d in A:
        return
    else:
        calc(d+1)
        calc(d+2)



calc(0)
print(cnt%1000000007)

Fixed submission:
import sys

n, m = map(int, sys.stdin.readline().split())
A = [int(sys.stdin.readline()) for _ in range(m)]
bloken = [0 for i in range(n+1)]
for a in A:
    bloken[a]=1
    

dp = [0 for i in range(n+1)]
dp[0] =1
#print(dp)

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


print(dp[-1]%1000000007)