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

n, m = map(int, input().split())
broken = [int(input()) for _ in range(m)]
f = [1, 1]

for i in range(2, n+1):
  f_nm1 = f[i-1] if i-1 not in broken else 0
  f_nm2 = f[i-2] if i-2 not in broken else 0
  f.append(f_nm1 + f_nm2)

print(f[-1]%1000000007)


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

n, m = map(int, input().split())
state = [1] * (n+1)

for _ in range(m):
  state[int(input())] = 0
  
f = [1, 1]

for i in range(2, n+1):
  f_nm1 = f[i-1] if state[i-1]==1 else 0
  f_nm2 = f[i-2] if state[i-2]==1 else 0
  f.append(f_nm1 + f_nm2)

print(f[-1]%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
broken = [int(input()) for _ in range(m)]
f = [1, 1]

for i in range(2, n+1):
  f_nm1 = f[i-1] if i-1 not in broken else 0
  f_nm2 = f[i-2] if i-2 not in broken else 0
  f.append(f_nm1 + f_nm2)

print(f[-1]%1000000007)


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

n, m = map(int, input().split())
state = [1] * (n+1)

for _ in range(m):
  state[int(input())] = 0
  
f = [1, 1]

for i in range(2, n+1):
  f_nm1 = f[i-1] if state[i-1]==1 else 0
  f_nm2 = f[i-2] if state[i-2]==1 else 0
  f.append(f_nm1 + f_nm2)

print(f[-1]%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
import operator as op
from functools import reduce
import sys
input = sys.stdin.readline

def ncr(n, r):
  r = min(r, n-r)
  numer = reduce(op.mul, range(n, n-r, -1), 1)
  denom = reduce(op.mul, range(1, r+1), 1)
  return numer // denom

def climbStairs(n):
  #if n == 0:
  #  return 0
  
  c = 0
  for i in range(n//2+1):
    c += ncr(i+n-2*i, i)
  return int(c)

n, m = map(int, input().split())

stairs = []
c = 0
for _ in range(m):
  broken = int(input())
  stairs.append(broken - c - 1)
  c = broken + 1

if c != n:
  stairs.append(n - c)

print(reduce(op.mul, map(climbStairs ,stairs), 1)%1000000007)



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

n, m = map(int, input().split())
state = [1] * (n+1)

for _ in range(m):
  state[int(input())] = 0
  
f = [1, 1]

for i in range(2, n+1):
  f_nm1 = f[i-1] if state[i-1]==1 else 0
  f_nm2 = f[i-2] if state[i-2]==1 else 0
  f.append(f_nm1 + f_nm2)

print(f[-1]%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
import operator as op
from functools import reduce

def ncr(n, r):
  r = min(r, n-r)
  numer = reduce(op.mul, range(n, n-r, -1), 1)
  denom = reduce(op.mul, range(1, r+1), 1)
  return numer // denom

def climbStairs(n):
  #if n == 0:
  #  return 0
  
  c = 0
  for i in range(n//2+1):
    c += ncr(i+n-2*i, i)
  return int(c)

n, m = map(int, input().split())

stairs = []
c = 0
for _ in range(m):
  broken = int(input())
  stairs.append(broken - c - 1)
  c = broken + 1

if c != n:
  stairs.append(n - c)

print(reduce(op.mul, map(climbStairs ,stairs), 1)%1000000007)



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

n, m = map(int, input().split())
state = [1] * (n+1)

for _ in range(m):
  state[int(input())] = 0
  
f = [1, 1]

for i in range(2, n+1):
  f_nm1 = f[i-1] if state[i-1]==1 else 0
  f_nm2 = f[i-2] if state[i-2]==1 else 0
  f.append(f_nm1 + f_nm2)

print(f[-1]%1000000007)