qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# coding: utf-8
# Your code here!
import sys

def input():
    return sys.stdin.readline().strip()

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
li = [1] + [0 for _ in range(N)]

for i in range(1, N + 1):
    if i in a:
        li[i] = 0
    else:
        li[i] = li[i - 1] + li[i - 2] % 1000000007
print(li[-1])

Fixed code:
# coding: utf-8
# Your code here!
import sys

def input():
    return sys.stdin.readline().strip()

N, M = map(int, input().split())
a = set(int(input()) for _ in range(M))
li = [1] + [0 for _ in range(N)]

for i in range(1, N + 1):
    if i in a:
        continue
    else:
        li[i] = li[i - 1] + li[i - 2]
print(li[-1] % 1000000007)
Buggy code:
N, M = map(int, input().split())
dp = [0] * N
for _ in range(M):
    a = int(input())
    dp[a-1] = -1

k = 1000000007


for i in range(N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    if i == 0:
        dp[i] = 1
        continue
    if i == 1:
        dp[i] = dp[i-1] + 1
        continue

    dp[i] = dp[i-1] + dp[i-2]
    dp[i] /= k



print(n)


Fixed code:
N, M = map(int, input().split())
dp = [0] * N
for _ in range(M):
    a = int(input())
    dp[a-1] = -1

k = 1000000007


for i in range(N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    if i == 0:
        dp[i] = 1
        continue
    if i == 1:
        dp[i] = dp[i-1] + 1
        continue

    dp[i] = dp[i-1] + dp[i-2]

n = dp[-1] % k

print(n)
Buggy code:
import numpy as np

N, M = map(int, input().split())
stairs_exist = np.ones(N+1)

for c in range(M):
    stairs_exist[int(input())] = 0
    
steps = np.zeros(N+1)
steps[0] = 1
for i in range(N):
    for j in range(i+1, min(N+1, i+3)):
        if stairs_exist[j]:
            steps[j] += steps[i]
            
print(int(steps[-1] % (10 ** 9 + 7)))

Fixed code:
import numpy as np

N, M = map(int, input().split())
stairs_exist = np.ones(N+1)
div_num = 10 ** 9 + 7

for c in range(M):
    stairs_exist[int(input())] = 0
    
steps = np.zeros(N+1)
steps[0] = 1
for i in range(N):
    for j in range(i+1, min(N+1, i+3)):
        if stairs_exist[j]:
            steps[j] += steps[i]
            steps[j] %= div_num
            
print(int(steps[-1]))
Buggy code:
import numpy as np

N, M = map(int, input().split())
a = [int(input()) for i in range(M)]

ans = np.zeros(N + 1)
ans[N] = 1

if N - 1 not in a:
    ans[N - 1] = 1

print(ans[N])

for i in range(2, N + 1):
    if N - i not in a:
        ans[N - i] = (ans[N - i + 1] + ans[N - i + 2]) % (10 ** 9 + 7)
    else:
        ans[N - i] = 0
        
print(ans[0])



Fixed code:
import numpy as np

N, M = map(int, input().split())
a = [int(input()) for i in range(M)]

ans = np.zeros(N + 1)
ans[N] = 1
broken_a = np.zeros(N)
for a_ in a:
    broken_a[a_] = 1
if broken_a[N-1] != 1:
    ans[N - 1] = 1


for i in range(2, N + 1):
    if broken_a[N - i] != 1:
        ans[N - i] = (ans[N - i + 1] + ans[N - i + 2]) % (10 ** 9 + 7)
    else:
        ans[N - i] = 0
print(int(ans[0]))
Buggy code:
mod=10**9+7
N,M=map(int,input().split())
A=[int(input()) for m in range(M)]
L=[1 for n in range(N+1)]
for a in A:
    L[a]=0
Block=[0,1]
for n in range(1,N+1):
    if L[n]==1:
        Block=Block[1:]+[sum(Block)]
    else:
        Block=Block[1:]+[0]
print(Block[-1])

Fixed code:
mod=10**9+7
N,M=map(int,input().split())
A=[int(input()) for m in range(M)]
L=[1 for n in range(N+1)]
for a in A:
    L[a]=0
Block=[0,1]
for n in range(1,N+1):
    if L[n]==1:
        Block=Block[1:]+[sum(Block)%mod]
        
    else:
        Block=Block[1:]+[0]
print(Block[-1])
Buggy code:
, m = map(int, input().split())
issafe = [True] * 10000
for _ in range(m):
    a = int(input())
    issafe[a] = False

dp = [0] * 10000
dp[0] = 1
if issafe[1]:
    dp[1] = 1

for i in range(1, n + 1):
    if  issafe[i - 1]:
        dp[i] = dp[i] + dp[i - 1]
    if issafe[i -  2]:
        dp[i] = dp[i - 2] + dp[i] 
    
    dp[i] %= 1000000007
    
print(dp[n])

Fixed code:
n, m = map(int, input().split())
issafe = [True] * (n +1)
for _ in range(m):
    a = int(input())
    issafe[a] = False

dp = [0] * (n + 1)
dp[0] = 1
if issafe[1]:
    dp[1] = 1

for i in range(2, n + 1):
    if  issafe[i - 1]:
        dp[i] = dp[i] + dp[i - 1]
    if issafe[i -  2]:
        dp[i] = dp[i - 2] + dp[i] 
    
    dp[i] %= 1000000007
    
print(dp[n])
Buggy code:
N, M = map(int, input().split())
a = [int(input())-1 for _ in range(M)]
mod =  1000000007
ret = [0] * N
for i in range(N):
    if i in a:
        continue
    elif i < 2:
        ret[i] = ret[i]+1
    else:
        ret[i] = ret[i-2] + ret[i-1]
        if ret[i] == 0:
            break


print(ret[len(ret)-1]%mod)


Fixed code:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
mod =  1000000007
ret = [-1] * (N+1)
ret[0] = 1
for i in a:
    ret[i] = 0

for i in range(1,N+1):
    if ret[i] == 0:
        continue
    elif i == 1:
        ret[1] = 1
    else:
        ret[i] = ret[i-2] + ret[i-1]

print(ret[len(ret)-1]%mod)
Buggy code:
N,M=map(int,input().split())
a={int(input()) for _ in range(M)}
print(a)

l=[0]*(N+1)
l[0]=1

for i in range(N):
    c=l[i]%1000000007
    if i>N-2:
        if i not in a:
            l[i+1]+=c
    elif i not in a:
        l[i+1]+=c
        l[i+2]+=c

print(l[N]%1000000007)

Fixed code:
N,M=map(int,input().split())
a={int(input()) for _ in range(M)}

l=[0]*(N+1)
l[0]=1

for i in range(N):
    c=l[i]%1000000007
    if i>N-2:
        if i not in a:
            l[i+1]+=c
    elif i not in a:
        l[i+1]+=c
        l[i+2]+=c

print(l[N]%1000000007)
Buggy code:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

nums = [0]*(N+1)
nums[0] = 1
if 1 not in a:
    nums[1] = 1
for i in range(2, N+1):
    print(nums)
    if not i in a:
      nums[i] = nums[i-1] + nums[i-2]

print(nums[N]%(1000000007))


Fixed code:
N, M = map(int, input().split())
a = set([int(input()) for _ in range(M)])

nums = [0]*(N+1)
nums[0] = 1
if 1 not in a:
    nums[1] = 1
for i in range(2, N+1):
    if not i in a:
      nums[i] = nums[i-1] + nums[i-2]

print(nums[N]%(1000000007))
Buggy code:
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
mod = 10**9 + 7
ans = [0] * (N+1)
ans[0] = 1
ans[1] = 1 if i not in a else 0
for i in range(2, N+1):
  ans[i] = (ans[i-1]+ans[i-2])%mod if i not in a else 0
print(ans[N])

Fixed code:
N, M = map(int, input().split())
A = set([int(input()) for _ in range(M)])
mod = 10**9 + 7
ans = [0] * (N+1)
ans[0] = 1
ans[1] = 1 if 1 not in A else 0
for i in range(2, N+1):
  ans[i] = (ans[i-1]+ans[i-2])%mod if i not in A else 0
print(ans[N])
Buggy code:
N, M=map(int, input().split())
mod=10**9+7
dp=[0 for i in range(N+1)]
dp[N] = 1
is_broken =[False for i in range(N+1)]

for i in range(M):
    a=int(input())
    is_broken[a] = True

for i in reversed(range(N)):
    if is_broken[i]:
        dp[i] = 0
        continue
    dp[i] = (dp[i+1] + dp[i+1]) % mod

print(dp[0])
    

Fixed code:
N, M=map(int, input().split())
mod=10**9+7
dp=[0 for i in range(N+2)]
dp[N] = 1
is_broken =[False for i in range(N+1)]

for i in range(M):
    a=int(input())
    is_broken[a] = True

for i in reversed(range(N)):
    if is_broken[i]:
        dp[i] = 0
        continue
    dp[i] = (dp[i+1] + dp[i+2]) % mod

print(dp[0])
Buggy code:
n,m = map(int,input().split())
flag = [0]*(n+1)
for i in range(m):
  a = int(input())
  flag[a] = 1
num = 10**9+7
count = [0]*(n+1)
count[0] = 1
count[1] = 1 if 1 not in a else 0
for i in range(2,n+1):
  if flag[i]==0: count[i] = count[i-1] + count[i-2]
  count[i] = count[i]%num
print(count[n])


Fixed code:
n,m = map(int,input().split())
flag = [0]*(n+1)
for i in range(m):
  a = int(input())
  flag[a] = 1
num = 10**9+7
count = [0]*(n+1)
count[0] = 1
count[1] = 1 if flag[1]==0 else 0
for i in range(2,n+1):
  if flag[i]==0: count[i] = count[i-1] + count[i-2]
  count[i] = count[i]%num
print(count[n])
Buggy code:
inf = 7 + (10 ** 9)
n, m = map(int, input().split())
dp1 = [0] * (n + 1)
dp1[0] = 1
for _ in range(m):
    a = int(input())
    dp1[a] = - inf
for i in range(n):
    if i < n:
        if (dp1[i + 1] != inf) & (dp1[i] != inf):
                dp1[i + 1] = dp1[i + 1] + dp[i]
    if i + 1 < n:
        if (dp1[i + 2] != inf) & (dp1[i] != inf):
                dp1[i + 2] = dp1[i + 2] + dp[i]
print(dp1[-1] % inf)

Fixed code:
inf = 7 + (10 ** 9)
n, m = map(int, input().split())
dp1 = [0] * (n + 1)
dp1[0] = 1
for _ in range(m):
    a = int(input())
    dp1[a] = - inf
for i in range(n):
    if i < n:
        if (dp1[i + 1] != -inf) & (dp1[i] != -inf):
                dp1[i + 1] = dp1[i + 1] + dp1[i]
    if i + 1 < n:
        if (dp1[i + 2] != -inf) & (dp1[i] != -inf):
                dp1[i + 2] = dp1[i + 2] + dp1[i]
print(dp1[-1] % inf)
Buggy code:
N, M = map(int, input().split())
status = [True]*(N+2)
for _ in range(M):
    status[int(input())] = False

dp = [0]*(N+2)
dp[0] = 1
for i in range(N):
    dp[i] = dp[i] % (10**9 + 7)
    if status[i+1]:
        dp[i+1] += dp[i]
    if status[i+2]:
        dp[i+2] += dp[i]
print(dp[N])


Fixed code:
N, M = map(int, input().split())
status = [True]*(N+2)
for _ in range(M):
    status[int(input())] = False

dp = [0]*(N+2)
dp[0] = 1
for i in range(N):
    dp[i] = dp[i] % (10**9 + 7)
    if status[i+1]:
        dp[i+1] += dp[i]
    if status[i+2]:
        dp[i+2] += dp[i]

print(dp[N] % (10**9+7))
Buggy code:
N,M  = map(int, input().split())
A = {}
mod = 10**9+7
for i in range(M):
    a = int(input())
    A[a] = 1
    if a-1 in A:
        print(0, '_', i)
        exit()

stairs = [0 for _ in range(N+2)]
stairs[0] = 1

for i in range(N):
    if i+1 not in A:
        stairs[i+1] = (stairs[i] + stairs[i+1]) % mod
    if i+2 not in A:
        stairs[i+2] = (stairs[i] + stairs[i+2]) % mod
        
print(stairs[N])


Fixed code:
N,M  = map(int, input().split())
A = {}
mod = 10**9+7
for i in range(M):
    a = int(input())
    A[a] = 1
    if a-1 in A:
        print(0)
        exit()

stairs = [0 for _ in range(N+2)]
stairs[0] = 1

for i in range(N):
    if i+1 not in A:
        stairs[i+1] = (stairs[i] + stairs[i+1]) % mod
    if i+2 not in A:
        stairs[i+2] = (stairs[i] + stairs[i+2]) % mod
        
print(stairs[N])
Buggy code:
n, m = map(int, input().split())
A = [True] * n
for _ in range(m):
  a = int(input())
  A[a] = False

mod = 10**9 + 7
dp = [0] * (n + 1)
dp[0] = 1
if 1 not in A:
  dp[1] = 1

for i in range(2, n+1):
  if A[i]:
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= mod

print(dp[n])

  


Fixed code:
n, m = map(int, input().split())
A = [True] * (n+1)
for _ in range(m):
  a = int(input())
  A[a] = False

mod = 10**9 + 7
dp = [0] * (n+1)
dp[0] = 1
if A[1]:
  dp[1] = 1

for i in range(2, n+1):
  if A[i]:
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= mod

print(dp[n])
Buggy code:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
MOD = 10**9 + 7

dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1 if 1 not in a else 0

a = set(range(2, N+2)) - set(a)
for i in a:
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[N] % MOD)

Fixed code:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
MOD = 10**9 + 7
 
dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1 if 1 not in a else 0
 
a = set(list(range(2,N+1))) - set(a)
for i in a:
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[N] % MOD)
Buggy code:
N, M = map(int, input().split())
oks = [True] * (N+1)
a = [int(input()) for _ in range(M)]
for i in a:
    oks[i] = False
dp = [0] * (N+1)
dp[0] = 1
for i in range(N+1):
    for j in range(i+1, min(i+2, N)+1):
        if oks[j]:
            dp[j] += int((dp[i]) % (1e9+7))


print(dp[N])

Fixed code:
N, M = map(int, input().split())
oks = [True] * (N+1)
a = [int(input()) for _ in range(M)]
for i in a:
    oks[i] = False

dp = [0] * (N+1)
dp[0] = 1
for i in range(N+1):
    for j in range(i+1, min(i+2, N)+1):
        if oks[j]:
            dp[j] += dp[i]
            dp[j] %= int(1e9+7)


print(dp[N])
Buggy code:
N,M =map(int,input().split())
a = [int(input()) for i in range(M)]
DP = [1]*N
mod = 10**9 + 7
for i in a:
    DP[i-1] = 0
for i in range(N):
    if(DP[i] != 0):
        if(i<1):
            DP[i+1] = DP[i]%mod
        else:
            DP[i] = (DP[i-2]%mod + DP[i-1]%mod)
print(DP[-1])

Fixed code:
N,M =map(int,input().split())
a = [int(input()) for i in range(M)]
DP = [1]*N
mod = 10**9 + 7
for i in a:
    DP[i-1] = 0
if(N != 1):
    for i in range(N):
        if(DP[i] != 0):
            if(i<1):
                DP[i] = DP[i-1]%mod
            else:
                DP[i] = (DP[i-2] + DP[i-1])%mod
else:
    DP = [1]
print(DP[-1])
Buggy code:
n,m=map(int,input().split())
D=[1] * (n + 1)
for _ in range(m):
    D[int(input())] = 0
for i in range(n+1):
    if i > 2:
        D[i] = (D[i-1] + D[i-2]) % 1000000007 * D[i]
print(D[i])

Fixed code:
n,m = map(int,input().split())
D=[1] * (n+1)
for _ in range(m):
    D[int(input())] = 0
for i in range(2, n+1):
    D[i] = (D[i-1] + D[i-2]) % 1000000007 * D[i]
print(D[n])
Buggy code:
n,m=map(int,input().split())
MOD = 1000000007 
D=[0] * (n+2)
D[0] = 1
for _ in range(m):
    D[int(input())] = -1
for i in range(n):
    if D[i] == -1:
        continue
    if D[i+1] != -1:
        D[i+1] += D[i]
    if D[i+2] != -1:
        D[i+2] += D[i]
    D[i]%=MOD
print(D[n])

Fixed code:
n,m=map(int,input().split())
MOD = 1000000007 
D=[0] * (n+2)
D[0] = 1
for _ in range(m):
    D[int(input())] = -1
for i in range(n):
    if D[i] == -1:
        continue
    if D[i+1] != -1:
        D[i+1] += D[i]
    if D[i+2] != -1:
        D[i+2] += D[i]
    D[i]%=MOD
print(D[n] % MOD)
Buggy code:
N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]
dp=[1]*(N+1)
if 1 in a:
  dp[1]=0
else:
  dp[1]=1
for i in range(1,N+1):
  if i in a:
    dp[i]=0
  else:
    dp[i]=dp[i-1]+dp[i-2]
  dp[i]%=1000000007
print(dp[N])




Fixed code:
N,M=map(int,input().split())
dp=[1]*(N+1)
for _ in range(M):
  i=int(input())
  dp[i]=0
for i in range(2,N+1):
  if dp[i]!=0:
      dp[i]=dp[i-1]+dp[i-2]
  dp[i]%=1000000007
print(dp[N])
Buggy code:
mod = 10**9+7
n,m = map(int,input().split())
a = set([int(input()) for _ in range(M)])
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1) :
    dp[i] = (dp[i-1] + dp[i-2]) % mod
    if i in a :
        dp[i] = 0

print(dp[n])

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

mod = 1000000007
brok= [False] * (n+1)

for i in a:
    brok[i] = True

dp = [1] * (n+2)
for i in range(0, n-1)[::-1]:
    if brok[i]:
        dp[i] = 0
        continue
    else:
        dp[i] = (dp[i+1]+dp[i+2]) % mod

print(dp[0])

Fixed code:
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

mod = 1000000007
brok = [False] * (n+1)

for i in a:
    brok[i] = True

dp = [0] * (n+2)
dp[n] = 1

for i in range(n-1, -1, -1):
    if brok[i]:
        dp[i] = 0
        continue
    else:
        dp[i] = (dp[i+1]+dp[i+2]) % mod

print(dp[0])
Buggy code:
p = 10**9 + 7
n,m = list(map(int, input().split()))
a = set()
a = [a.add(int(input())) for _ in range(m)]

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

for i in range(n):
    if i+2 not in a:
        dp[i+2] += dp[i]%p
    if i+1 not in a:
        dp[i+1] += dp[i]%p

print(dp[-2]%p)

Fixed code:
p = 10**9 + 7
n,m = list(map(int, input().split()))
a = set()
for _ in  range(m):
    a.add(int(input()))

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

for i in range(n):
    if i+2 not in a:
        dp[i+2] += dp[i]%p
    if i+1 not in a:
        dp[i+1] += dp[i]%p

print(dp[-2]%p)
Buggy code:
N, M = list(map(int, input().split()))
a = []
for _ in range(M):
    a.append(int(input()))
a = list(set(a))
dif = [a[0]-1]
dif.extend([(a[i]-1)-(a[i-1]+1) for i in range(1,len(a))])
dif.extend([N-a[-1]-1])
max_dif = max(dif)
Fiblist = {-1:0,0:1,1:1,2:2}
for n in range(3,max_dif+1):
    Fiblist[n]=Fiblist[n-1]+Fiblist[n-2]
ans = 1
for part in dif:
    ans= ans*Fiblist[part]%1000000007
print(ans)

Fixed code:
N, M = list(map(int, input().split()))
a = []
for _ in range(M):
    a.append(int(input()))
a = sorted(list(set(a)))
if len(a)>0:
    dif = [a[0]-1]
    dif.extend([(a[i]-1)-(a[i-1]+1) for i in range(1,len(a))])
    dif.extend([N-a[-1]-1])
else:
    dif = [N]
max_dif = max(dif)
Fiblist = {-1:0,0:1,1:1,2:2}
for n in range(3,max_dif+1):
    Fiblist[n]=Fiblist[n-1]+Fiblist[n-2]
ans = 1
for part in dif:
    ans= ans*Fiblist[part]%1000000007
print(ans)
Buggy code:
def solve(N, M, A):
    answer = [0] * (N+1)
    answer[0] = 1
    if 1 in A:
        answer[1] = 0
    else:
        answer[1] = 1

    for s in range(2, N+1):
        if s in A:
            answer[s] = 0
        else:
            answer[s] = (answer[s-2] + answer[s-1])
    print(answer[N] % 1000000007)

N, M = [int(x) for x in input().split()]
A = set()
for i in range(M):
    A.add(int(input().split()))
solve(N, M, A)



Fixed code:
def solve(N, M, A):
    answer = [0] * (N+1)
    answer[0] = 1
    if 1 in A:
        answer[1] = 0
    else:
        answer[1] = 1

    for s in range(2, N+1):
        if s in A:
            answer[s] = 0
        else:
            answer[s] = (answer[s-2] + answer[s-1]) % 1000000007
    print(answer[N])

N, M = [int(x) for x in input().split()]
A = set()
for i in range(M):
    A.add(int(input()))
solve(N, M, A)
Buggy code:
n,m = map(int,input().split())
a =  [int(input()) for i in range(m)]

dp =[0]*(n+1)
if 0 in a:
    dp[0] =0
else:
    dp[0]=1

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

for i in range(2,n+1):

    if dp[i-1]==dp[i-2]==0:break

    dp[i] = (dp[i-2]+dp[i-1])

    if i in a[i]:
        dp[i] = 0

print(dp[-1]%1000000007)

Fixed code:
n,m = map(int,input().split())
a =  [int(input()) for i in range(m)]

dp =[0]*(n+1)

for i in a:
    dp[i] = -1

for i in [0,1]:
    if dp[i] == -1:
        dp[i] =0
    else:
        dp[i] =1

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

print(dp[-1]%1000000007)
Buggy code:
CONST = 10**9 + 7
n,m = map(int,input().split())

dp = [-1 for _ in range(n+1)]
dp[0] = 1
dp[1] = 2
for _ in range(m):
  a = int(input())
  dp[a] = 0
  if a == 0 and  dp[1] ==2:
    dp[1] = 1

for i in range(2,n):
  if dp[i] == 0:
    continue
  dp[i] = (dp[i-1] + dp[i-2]) % CONST
print(dp[n])

Fixed code:
CONST = 10**9 + 7
n,m = map(int,input().split())

dp = [-1 for _ in range(n+1)]
dp[0] = 1
dp[1] = 1
for _ in range(m):
  a = int(input())
  dp[a] = 0


for i in range(2,n+1):
  if dp[i] == 0:
    continue
  dp[i] = (dp[i-1] + dp[i-2]) % CONST
print(dp[n])
Buggy code:
#https://atcoder.jp/contests/abc129/tasks/abc129_c
N,M = map(int,input().split())
dp = [[] for i in range(N)]
for i in range(M):
    dp[int(input())-1] = 0

for i in range(N):
    if dp[i] != 0:
        if i == 0:
            dp[i] = 1
        elif i == 1:
            dp[i] = 2
        else:
            dp[i] = dp[i-1] + dp[i-2]
        
print(dp[-1])     

Fixed code:
#https://atcoder.jp/contests/abc129/tasks/abc129_c
N,M = map(int,input().split())
dp = [[] for i in range(N)]
for i in range(M):
    dp[int(input())-1] = 0

for i in range(N):
    if dp[i] != 0:
        if i == 0:
            dp[i] = 1
        elif i == 1:
            dp[i] = dp[i-1] + 1
        else:
            dp[i] = dp[i-1] + dp[i-2]
        
print(dp[-1] % 1000000007)
Buggy code:
#https://atcoder.jp/contests/abc129/tasks/abc129_c
N,M = map(int,input().split())
Danger_List = []
Route_List = [[] for i in range(N+1)]
for i in range(M):
    Route_List[int(input())] = 0
        
Route_List[0] = 1

for i in range(1,N+1):
    if Route_List[i] != 0:
        if i == 1:
            Route_List[i] = 1
        else:
            Route_List[i] = Route_List[i-1] + Route_List[i-2]

    
    
        
print(Route_List[-1])

Fixed code:
#https://atcoder.jp/contests/abc129/tasks/abc129_c
N,M = map(int,input().split())
Danger_List = []
Route_List = [[] for i in range(N+1)]
for i in range(M):
    Route_List[int(input())] = 0
        
Route_List[0] = 1

for i in range(1,N+1):
    if Route_List[i] != 0:
        if i == 1:
            Route_List[i] = 1
        else:
            Route_List[i] = Route_List[i-1] + Route_List[i-2]

    
    
        
print(Route_List[-1] % 1000000007)
Buggy code:
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

dp = [0] * (n + 10)
dp[0] = 1
mod = 1e9 + 7

ok = [1] * (n + 10)
for i in a:
    ok[i] = 0

for i in range(n):
    if ok[i + 1]:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
    if ok[i + 2]:
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod
print(dp[n])


Fixed code:
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

dp = [0] * (n + 10)
dp[0] = 1
mod = 1e9 + 7

ok = [1] * (n + 10)
for i in a:
    ok[i] = 0

for i in range(n):
    if ok[i + 1]:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
    if ok[i + 2]:
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod
print(int(dp[n]))
Buggy code:
n, m = map(int, input().split())
dp = [0] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    dp[aa] = -1
    a.append(aa)
mod = 10 ** 9 + 7

dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[0] = 1
for i in range(1, n):
    if dp[i + 1] == -1:
        dp[i + 1] = 0
    else:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])

Fixed code:
n, m = map(int, input().split())
dp = [-1] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    dp[aa] = 0
    a.append(aa)
for i in range(m - 1):
    if a[i] + 1 == a[i + 1]:
        print(0)
        exit()
mod = 10 ** 9 + 7

dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == 0:
        continue
    else:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])
Buggy code:
n, m = map(int, input().split())
dp = [-1] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    a.append(aa)
    dp[aa - 1] = 0
mod = 10 ** 9 + 7

dp[0] = 1
if a[0] != 1:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == -1:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])

Fixed code:
n, m = map(int, input().split())
dp = [0] * (n + 1)
a = []
for i in range(m):
    aa = int(input())
    dp[aa] = -1
    a.append(aa)
for i in range(m - 1):
    if a[i] + 1 == a[i + 1]:
        print(0)
        exit()
mod = 10 ** 9 + 7

dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(1, n):
    if dp[i + 1] == -1:
        dp[i + 1] = 0
    else:
        dp[i + 1] = (dp[i] + dp[i - 1]) % mod
print(dp[n])
Buggy code:
n, m = map(int, input().split())
keep = [0] * (n + 1)
kep = [-1] * (n + 1)
keep[0] = 1
keep[1] = 1
for i in range(m):
    a = int(input())
    kep[a] = 0
for j in range(2, n + 1):
    keep[j] = [0, keep[j - 2] + keep[j - 1]][kep[j]] % 1000000007
print(keep[n])


Fixed code:
n, m = map(int, input().split())
keep = [0] * (n + 1)
kep = [-1] * (n + 1)

for i in range(m):
    a = int(input())
    kep[a] = 0
keep[0] = 1
keep[1] = 0 if kep[1] == 0 else 1
for j in range(0, n - 1):
    keep[j + 2] = [0, keep[j] + keep[j + 1]][kep[j + 2]] % 1000000007
print(keep[n])
Buggy code:
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
dp = [float("inf")] * (n+1)
dp[0] = 1
dp[1] = 1
for i in a:
    dp[i] = 0
for i in range(2, n+1):
    dp[i] = min(dp[i], (dp[i-1] + dp[i-2])%10**9+7)
print(dp[n])


Fixed code:
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
dp = [float("inf")] * (n+1)
dp[0] = 1
dp[1] = 1
for i in a:
    dp[i] = 0
for i in range(2, n+1):
    dp[i] = min(dp[i], (dp[i-1] + dp[i-2])%(10**9+7))
print(dp[n])
Buggy code:
N,M = map(int,input().split())
a = set([int(input()) for i in range(M)])
dp = [0]*(N+1)
dp[1] = 1

if 1 in a:
    dp[2] = 1
    dp[1] = 0
else:
    dp[2] = 2
for i in range(3,N+1):
    if i-1 in a:
        continue
    
    dp[i] = (dp[i-2]+dp[i-1])%1000000007
ans = dp[N]
print(ans)



Fixed code:
N,M = map(int,input().split())
a = set([int(input()) for i in range(M)])
dp = [0]*(N+1)
dp[0] = 1
dp[1] = 1
if 1 in a:
    dp[1] = 0
for i in range(2,N+1):
    if i in a:
        continue
    
    dp[i] = (dp[i-2]+dp[i-1])%1000000007
ans = dp[N]
print(ans)