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

Fixed submission:
n,m = map(int, input().split())
a = set([int(input()) for i in range(m)])
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])

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

Fixed submission:
n,m = map(int, input().split())
a = set([int(input()) for i in range(m)])
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
a = [int(input()) for i in range(m)]
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])

Fixed submission:
n,m = map(int, input().split())
a = set([int(input()) for i in range(m)])
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
a = [int(input()) for i in range(m)]
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = memo[i-1] + memo[i-2]

print(memo[n]%1000000007)

Fixed submission:
n,m = map(int, input().split())
a = set([int(input()) for i in range(m)])
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])

Buggy python submission (verdict: Runtime Error):
memo = [0]*10**6 #i番目の数列を格納するためのメモ
def fib(n):
    if n in a:
        return 0
    if n<=1:
        return 1 #0,1番目の数列はo,1
    if memo[n] != 0:
        return memo[n] #i番目の数列がmemoにある場合それを返す
    memo[n] = fib(n-1) + fib(n-2) #i番目の数列の計算
    return memo[n]

print(fib(i)%1000000007)


Fixed submission:
n,m = map(int, input().split())
a = set([int(input()) for i in range(m)])
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])

Buggy python submission (verdict: Runtime Error):
i,m = map(int, input().split())
a = [int(input()) for i in range(m)]

memo = [0]*10**5 #i番目の数列を格納するためのメモ
def fib(n):
    if n in a:
        return 0
    if n<=1:
        return 1 #0,1番目の数列はo,1
    if memo[n] != 0:
        return memo[n] #i番目の数列がmemoにある場合それを返す
    memo[n] = fib(n-1) + fib(n-2) #i番目の数列の計算
    return memo[n]

print(fib(i)%1000000007)

Fixed submission:
n,m = map(int, input().split())
a = set([int(input()) for i in range(m)])
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])