Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
 
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
         
MOD = 10**9+7
n = [1, 1]
cnt = 2
while cnt!=N+1:
    if cnt-1 in a:n[1]=0
    n[0], n[1] = n[1], (n[0]+n[1])%MOD 
    cnt += 1
    if n[1]==0:break
 
print(n[-1]%(10**9+7))

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())

broken= [False]*(N+1)
for i in range(M):
    broken[int(input())] = True

dp = [0]*(N+1)
dp[0] = 1
if not broken[1]:dp[1] = 1

         
for i in range(2, N+1):
    if broken[i]:continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= (10**9 + 7)
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
         
n = [1, 1]
cnt = 2
while cnt!=N+1:
    if cnt-1 in a:n[1]=0
    n[0], n[1] = n[1], n[0]+n[1] 
    cnt += 1
    if n[1]==0:break

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

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())

broken= [False]*(N+1)
for i in range(M):
    broken[int(input())] = True

dp = [0]*(N+1)
dp[0] = 1
if not broken[1]:dp[1] = 1

         
for i in range(2, N+1):
    if broken[i]:continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= (10**9 + 7)
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
         
n = [1, 1]
cnt = 2
while cnt!=N+1:
    if cnt-1 in a:n[1]=0
    n[0], n[1] = n[1], n[0]+n[1] 
    cnt += 1
    if n[1]==0:break

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

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())

broken= [False]*(N+1)
for i in range(M):
    broken[int(input())] = True

dp = [0]*(N+1)
dp[0] = 1
if not broken[1]:dp[1] = 1

         
for i in range(2, N+1):
    if broken[i]:continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= (10**9 + 7)
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
         
n = [1, 1]
cnt = 2
while cnt!=N+1:
    if cnt-2 in a:n[0]=0
    if cnt-1 in a:n[1]=0
    n[0], n[1] = n[1], n[0]+n[1] 
    cnt += 1
    if n==[0,0]:break

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

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())

broken= [False]*(N+1)
for i in range(M):
    broken[int(input())] = True

dp = [0]*(N+1)
dp[0] = 1
if not broken[1]:dp[1] = 1

         
for i in range(2, N+1):
    if broken[i]:continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= (10**9 + 7)
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
         
n = [1, 1]
cnt = 2
while cnt!=N+1:
    if cnt-2 in a:n[0]=0
    if cnt-1 in a:n[1]=0
    n[0], n[1] = n[1], n[0]+n[1] 
    cnt += 1

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

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())

broken= [False]*(N+1)
for i in range(M):
    broken[int(input())] = True

dp = [0]*(N+1)
dp[0] = 1
if not broken[1]:dp[1] = 1

         
for i in range(2, N+1):
    if broken[i]:continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= (10**9 + 7)
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
         
n = [1, 1]
  
for i in range(2, N+1):
    if i-2 in a:n[i-2]=0
    if i-1 in a:n[i-1]=0
    n.append(n[i-2]+n[i-1])

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

Fixed submission:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())

broken= [False]*(N+1)
for i in range(M):
    broken[int(input())] = True

dp = [0]*(N+1)
dp[0] = 1
if not broken[1]:dp[1] = 1

         
for i in range(2, N+1):
    if broken[i]:continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= (10**9 + 7)
print(dp[N])