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



dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1]%MOD)


Fixed submission:
N,M = map(int,input().split())
A = set([int(input()) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print(0)
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
mod=10**9+7
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=[int(input()) for _ in range(m)]

if 0 in a:
    print(0)
    exit()
for i in range(n):
    if i+1 not    in a:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if i+2<=n and i+2 not  in a:
        dp[i+2]+=dp[i]
        dp[i+1]%=mod
print(dp[-1]%mod)

Fixed submission:
N,M = map(int,input().split())
A = set([int(input()) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print(0)
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
mod=10**9+7
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=[int(input()) for _ in range(m)]

if 0 in a:
    print(0)
    exit()
for i in range(n):
    if i+1 not    in a:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if i+2<=n and i+2 not  in a:
        dp[i+2]+=dp[i]
        dp[i+1]%=mod
print(dp[-1]%mod)

Fixed submission:
N,M = map(int,input().split())
A = set([int(input()) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print(0)
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
mod=10**9+7
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=[int(input()) for _ in range(m)]
for i in range(n):
    if i+1 not    in a:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if i+2<=n and i+2 not  in a:
        dp[i+2]+=dp[i]
        dp[i+1]%=mod
print(dp[-1]%mod)

Fixed submission:
N,M = map(int,input().split())
A = set([int(input()) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print(0)
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
mod=10**9+7
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=[int(input()) for _ in range(m)]
for i in range(n):
    if i+1 not    in a:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if i+2<=n and i+2 not  in a:
        dp[i+2]+=dp[i]
        dp[i+1]%=mod
print(dp[-1]%mod)

Fixed submission:
N,M = map(int,input().split())
A = set([int(input()) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print(0)
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
mod=10**9+7
n,m=map(int,input().split())
dp=[0]*(n+1)
dp[0]=1
a=[int(input()) for _ in range(m)]
for i in range(n):
    if i+1 not    in a:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if i+2<=n and i+2 not  in a:
        dp[i+2]+=dp[i]
        dp[i+1]%=mod
print(dp[-1]%mod)

Fixed submission:
N,M = map(int,input().split())
A = set([int(input()) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print(0)
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
ans=10**10
n=int(input())
w=list(map(int,input().split()))
for i in range(1,n):
    ans=min(ans,abs(sum(w[:i])-sum(w[i:])))

print(ans)AC

Fixed submission:
N,M = map(int,input().split())
A = set([int(input()) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print(0)
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print(dp[-1])