Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=[int(input()) for i in range(M)]
if 1 in A:
    B=[1]+[0]*N
else:
    B=[1]+[1]+[0]*(N-1)
i=2
while i<=N:
    if i not in A:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print(B[N])

Fixed submission:
N,M=map(int,input().split())
B=[1]+[1]+[0]*(N-1)
for j in range(M):
    a=int(input())
    B[a]=-1
    if a==1:
        B[a]=0
i=2
while i<=N:
    if B[i]==-1:
        B[i]=0
    else:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print(B[N])

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=[int(input()) for i in range(M)]
if 1 in A:
    B=[1]+[0]*N
else:
    B=[1]+[1]+[0]*(N-1)
for i in range(2,N+1):
    if i not in A:
        B[i]=(B[i-1]+B[i-2])%(10**9+7)
print(B[-1])

Fixed submission:
N,M=map(int,input().split())
B=[1]+[1]+[0]*(N-1)
for j in range(M):
    a=int(input())
    B[a]=-1
    if a==1:
        B[a]=0
i=2
while i<=N:
    if B[i]==-1:
        B[i]=0
    else:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print(B[N])

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=[int(input()) for i in range(M)]
if 1 in A:
    B=[1]+[0]*N
else:
    B=[1]+[1]+[0]*(N-1)
for i in range(2,N+1):
    if i not in A:
        B[i]=B[i-1]+B[i-2]
print(B[-1]%(10**9+7))

Fixed submission:
N,M=map(int,input().split())
B=[1]+[1]+[0]*(N-1)
for j in range(M):
    a=int(input())
    B[a]=-1
    if a==1:
        B[a]=0
i=2
while i<=N:
    if B[i]==-1:
        B[i]=0
    else:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print(B[N])

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=[int(input()) for i in range(M)]
l=0
r=1
ans=0
for i in range(1,N+1):
    if i in A:
        ans=0
        l=r
        r=ans
    else:
        ans=l+r
        l=r
        r=ans
print(ans%(10**9+7))

Fixed submission:
N,M=map(int,input().split())
B=[1]+[1]+[0]*(N-1)
for j in range(M):
    a=int(input())
    B[a]=-1
    if a==1:
        B[a]=0
i=2
while i<=N:
    if B[i]==-1:
        B[i]=0
    else:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print(B[N])

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=[int(input()) for i in range(M)]
l=0
r=1
ans=0
for i in range(1,N+1):
    if i in A:
        ans=0
        l=r
        r=ans
    else:
        ans=l+r
        l=r
        r=ans
print(ans%(10**9+7))

Fixed submission:
N,M=map(int,input().split())
B=[1]+[1]+[0]*(N-1)
for j in range(M):
    a=int(input())
    B[a]=-1
    if a==1:
        B[a]=0
i=2
while i<=N:
    if B[i]==-1:
        B[i]=0
    else:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print(B[N])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    if i in a:
        dp[i]=0
print(dp[n])

Fixed submission:
N,M=map(int,input().split())
B=[1]+[1]+[0]*(N-1)
for j in range(M):
    a=int(input())
    B[a]=-1
    if a==1:
        B[a]=0
i=2
while i<=N:
    if B[i]==-1:
        B[i]=0
    else:
        B[i] = (B[i - 1] + B[i - 2]) % (10 ** 9 + 7)
    i+=1
print(B[N])