Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
MOD = 10**9+7
broken = [int(input()) for _ in range(M)]
l = [0]*(N+1)

for i in range(N+1):
    if i in broken:
        continue
    elif i==0 or i==1:
        l[i] = 1
    else:
        l[i] = l[i-1] + l[i-2]
    l[i] %= MOD

print(l[N])

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(50000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(30000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
back2 = 0
back1 = 1
MOD = int(1e9+7)

for i in range(n):
    if i + 1 in bad:
        back2, back1 = back1%MOD, 0
    else:
        back2, back1 = back1%MOD, (back2+back1)%MOD

print(back1)

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
back2 = 0
back1 = 1
MOD = int(1e9+7)

for i in range(n):
    if i + 1 in bad:
        back2, back1 = back1%MOD, 0
    else:
        back2, back1 = back1%MOD, (back2+back1)%MOD

print(back1)

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
back2 = 0
back1 = 1
MOD = int(1e9+7)

for i in range(n):
    if i + 1 in bad:
        back2, back1 = back1, 0
    else:
        back2, back1 = back1, back2+back1

print(back1%MOD)

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
back2 = 0
back1 = 1
MOD = int(1e9+7)

for i in range(n):
    if i + 1 in bad:
        back2, back1 = back1, 0
    else:
        back2, back1 = back1, back2+back1

print(back1%MOD)

Fixed submission:
import sys
sys.setrecursionlimit(150000)

n, m = map(int, input().split())
bad = [int(input()) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print(fib(n, MOD))