Buggy python submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False

dp = [0] * (N + 1)
if ok[1]:
    dp[1] = 1
if ok[2]:
    dp[2] = 2
for s in range(3, N + 1):
    if ok[s]:
        dp[s] = dp[s-1] + dp[s-2]
        dp[s] %= 1000000007
    else:
        dp[s] = 0

print(dp[N])

Fixed submission:
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
ans = 0
if N == 1:
    ans = 1
else:
    counts = [0] * (N + 1)
    if ok[1]:
        counts[1] = 1
    if ok[2]:
        counts[2] = counts[1] + 1
    for s in range(3, N + 1):
        if ok[s]:
            count = counts[s-1] + counts[s-2]
            count %= 1000000007
            counts[s] = count
    ans = counts[N]
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False

dp = [0] * (N + 1)
dp[1] = 1
dp[2] = 2
for s in range(3, N + 1):
    if ok[s]:
        dp[s] = dp[s-1] + dp[s-2]
        dp[s] %= 1000000007
    else:
        dp[s] = 0

print(dp[N])

Fixed submission:
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
ans = 0
if N == 1:
    ans = 1
else:
    counts = [0] * (N + 1)
    if ok[1]:
        counts[1] = 1
    if ok[2]:
        counts[2] = counts[1] + 1
    for s in range(3, N + 1):
        if ok[s]:
            count = counts[s-1] + counts[s-2]
            count %= 1000000007
            counts[s] = count
    ans = counts[N]
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
from functools import lru_cache
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
sys.setrecursionlimit(N + 10000)
@lru_cache(maxsize=None)
def f(s):
    if not ok[s]:
        return 0
    if s in (0, 1, 2):
        return s
    count = f(s - 1) + f(s - 2)
    count %= 1000000007
    return count

ans = f(N)
print(ans)

Fixed submission:
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
ans = 0
if N == 1:
    ans = 1
else:
    counts = [0] * (N + 1)
    if ok[1]:
        counts[1] = 1
    if ok[2]:
        counts[2] = counts[1] + 1
    for s in range(3, N + 1):
        if ok[s]:
            count = counts[s-1] + counts[s-2]
            count %= 1000000007
            counts[s] = count
    ans = counts[N]
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
from functools import lru_cache
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
sys.setrecursionlimit(N + 100)
@lru_cache(maxsize=None)
def f(s):
    if not ok[s]:
        return 0
    if s in (0, 1, 2):
        return s
    count = f(s - 1) + f(s - 2)
    count %= 1000000007
    return count

ans = f(N)
print(ans)

Fixed submission:
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
ans = 0
if N == 1:
    ans = 1
else:
    counts = [0] * (N + 1)
    if ok[1]:
        counts[1] = 1
    if ok[2]:
        counts[2] = counts[1] + 1
    for s in range(3, N + 1):
        if ok[s]:
            count = counts[s-1] + counts[s-2]
            count %= 1000000007
            counts[s] = count
    ans = counts[N]
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
from functools import lru_cache
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False

@lru_cache(maxsize=None)
def f(s):
    if not ok[s]:
        return 0
    if s in (0, 1, 2):
        return s
    count = f(s - 1) + f(s - 2)
    count %= 1000000007
    return count

ans = f(N)
print(ans)

Fixed submission:
import sys
N, M = map(int, input().split())
ok = [True] * (N + 1)
for _ in range(M):
    a = int(sys.stdin.readline())
    ok[a] = False
ans = 0
if N == 1:
    ans = 1
else:
    counts = [0] * (N + 1)
    if ok[1]:
        counts[1] = 1
    if ok[2]:
        counts[2] = counts[1] + 1
    for s in range(3, N + 1):
        if ok[s]:
            count = counts[s-1] + counts[s-2]
            count %= 1000000007
            counts[s] = count
    ans = counts[N]
print(ans)