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

Fixed submission:
N,M=map(int,input().split())
br=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
if not 1 in br:
    dp[1]=1
for i in range(2,N+1):
    if not i in br:
        dp[i]+=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[int(input()) for i in range(m)]
DP=[0]*(n+1)
temp=0
DP[0]=1
for i in range(1, n+1):
  if i==1 and not in lst:
    DP[i]=1
  elif i in lst:
    DP[i]=0
  else:
    DP[i]=DP[i-1]+DP[i-2]
print(DP[n]%1000000007)

Fixed submission:
N,M=map(int,input().split())
br=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
if not 1 in br:
    dp[1]=1
for i in range(2,N+1):
    if not i in br:
        dp[i]+=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
lst=[int(input()) for i in range(m)]
DP=[0]*(n+1)
temp=0
DP[0]=1
for i in range(1, n+1):
  if i==1 and i not in lst:
    DP[i]=1
  elif i==1 and i in lst:
    DP[i]=0
  elif i in lst:
    DP[i]=0
  else:
    DP[i]=DP[i-1]+DP[i-2]
print(DP[n]%1000000007)

Fixed submission:
N,M=map(int,input().split())
br=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
if not 1 in br:
    dp[1]=1
for i in range(2,N+1):
    if not i in br:
        dp[i]+=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
lst=[int(input()) for i in range(m)]
DP=[0]*(n+1)
temp=0
DP[0]=1
for i in range(1, n+1):
  if i==1 and i not in lst:
    DP[i]=1
  elif i==1 and i in lst:
    DP[i]=1
    temp=i+1
  else:
    if i-1 not in lst and i-2 not in lst:
      DP[i]+=DP[i-1]+DP[i-2]
    elif i-1 not in lst and i-2 in lst:
      DP[i]+=DP[i-1]
    elif i-1 in lst and i-2 not in lst:
      DP[i]+=DP[i-2]
    else:
      break;
print(DP[n]%1000000007)

Fixed submission:
N,M=map(int,input().split())
br=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
if not 1 in br:
    dp[1]=1
for i in range(2,N+1):
    if not i in br:
        dp[i]+=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
lst=[int(input()) for i in range(m)]
DP=[0]*(n+1)
temp=0
DP[0]=1
for i in range(1, n+1):
  if i==1 and i not in lst:
    DP[i]=1
  elif i==1 and i in lst:
    DP[i]=1
    temp=i+1
  else:
    if i-1 not in lst and i-2 not in lst:
      DP[i]+=DP[i-1]+DP[i-2]
    elif i-1 not in lst and i-2 in lst:
      DP[i]+=DP[i-1]
    elif i-1 in lst and i-2 not in lst:
      DP[i]+=DP[i-2]
    else:
      break;
print(DP[n]%1000000007)

Fixed submission:
N,M=map(int,input().split())
br=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
if not 1 in br:
    dp[1]=1
for i in range(2,N+1):
    if not i in br:
        dp[i]+=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
lst=[int(input()) for i in range(m)]
DP=[0]*(n+1)
temp=0
DP[0]=1
for i in range(1, n+1):
  if i==1:
    DP[i]=1
    if i in lst:
      temp=i+1
  elif i!=temp and i in lst:
    DP[i]=DP[i-1]
    temp=i+1
  elif i==temp:
    if i in lst:
      break;
    else:
      DP[i]=DP[i-1]
  elif i-2 in lst:
    DP[i]=DP[i-1]
  else:
    DP[i]=DP[i-1]+DP[i-2]
print(DP[n]%1000000007)

Fixed submission:
N,M=map(int,input().split())
br=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
if not 1 in br:
    dp[1]=1
for i in range(2,N+1):
    if not i in br:
        dp[i]+=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
lst=[int(input()) for i in range(m)]
DP=[0]*(n+1)
temp=0
DP[0]=1
for i in range(1, n+1):
  if i==1 and i not in lst:
    DP[i]=1
  elif i==1 and i in lst:
    DP[i]=1
    temp=i+1
  elif i!=temp and i in lst:
    DP[i]=DP[i-1]
    temp=i+1
  elif i==temp and i in lst:
    break;
  elif i==temp and i not in lst:
    DP[i]=DP[i-1]
  elif i-2 in lst:
    DP[i]=DP[i-1]
  else:
    DP[i]=DP[i-1]+DP[i-2]
print(DP[n]%1000000007)

Fixed submission:
N,M=map(int,input().split())
br=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
if not 1 in br:
    dp[1]=1
for i in range(2,N+1):
    if not i in br:
        dp[i]+=(dp[i-1]+dp[i-2])%1000000007
print(dp[-1])