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

Fixed submission:
n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
if m!=0:
    ls = [int(input()) for _ in range(m)]

else:
    ls = []

dp = [0 for _ in range(n+1)]
dp[0]=1

if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1

for i in range(2,n+1):
    if i in ls :
        dp[i] = 0
    else:
        dp[i] = (dp[i-1]+dp[i-2])%(10**9+7)
        
print(dp[n]%(10**9+7))

Fixed submission:
n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
if m!=0:
    ls = [int(input()) for _ in range(m)]

else:
    ls = []

dp = [0 for _ in range(n+1)]
dp[0]=1

if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1

for i in range(2,n+1):
    if i in ls :
        dp[i] = 0
    else:
        dp[i] = dp[i-1]+dp[i-2]
        
print(dp[n]%(10**9+7))

Fixed submission:
n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
if m!=0:
    ls = [int(input()) for _ in range(m)]

else:
    ls = []
    
dp = [0 for _ in range(n+1)]
dp[1] = 1
dp[2] = 2

for i in range(3,n+1):
    if i in ls :
        dp[i] = 0
    else:
        dp[i] = (dp[i-1]+dp[i-2])%(10**9+7)

print(dp[n]%(10**9+7))

Fixed submission:
n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

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

dp = [0 for _ in range(n+1)]
dp[1] = 1
dp[2] = 2

for i in range(3,n+1):
    if i in ls :
        dp[i] = 0
    else:
        dp[i] = dp[i-1]+dp[i-2]

print(dp[n]%(10**9+7))

Fixed submission:
n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

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

dp = [0 for _ in range(n+1)]
dp[1] = 1
dp[2] = 2

for i in range(3,n+1):
    if i in ls :
        dp[i] = 0
    else:
        dp[i] = dp[i-1]+dp[i-2]

print(dp[n]%(10**9+7))

Fixed submission:
n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

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

dp = [0 for _ in range(n+1)]
dp[1] = 1
dp[2] = 2

for i in range(3,n+1):
    if i in ls :
        dp[i] = 0
    else:
        dp[i] = dp[i-1]+dp[i-2]

print(dp)

print(dp[n]%(10**9+7))

Fixed submission:
n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())

a = [int(x) for x in input()]



def solve(n,now,ls,cnt):
    if n == now:
        return cnt
    elif n-1 == now:
        return cnt
    else:
        pass

    if now+1 in ls and now+2 in ls:
        return 0
    elif   now+1 in ls:
        return solve(n,now+2,ls,cnt)
    elif   now+2 in ls:
        return solve(n,now+1,ls,cnt)
    else:
        return solve(n,now+2,ls,cnt*2)

ans = solve(n,0,a,1)

print(ans%(1000000007))

Fixed submission:
n,m = map(int,input().split())
ls = set()
for i in range(m):
    ls.add(int(input()))
dp = [0]*(n+1)
dp[0]=1
if 1 in ls:
    dp[1]= 0
else:
    dp[1]= 1
for i in range(2,n+1):
    if i in ls :
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n]%(10**9+7))