Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, k, s = map(int,input().split())
anslist = [0] * n
for i in range(k):
    anslist[i] = s
for i in range(len(anslist)):
    print(s[i])

Fixed submission:
n, k, s = map(int,input().split())

if s != int(1e9):
    anslist = [int(1e9)] * n
    for i in range(k):
        anslist[i] = s
    for i in range(len(anslist)):
        print(anslist[i])
else:
    anslist = [1] * n
    for i in range(k):
        anslist[i] = s
    for i in range(len(anslist)):
        print(anslist[i])
Buggy python submission (verdict: Runtime Error):
MAX = 600000
MOD = 10 ** 9 + 7
fac = [0] * MAX
ifac = [0] * MAX
fac[0] = 1
for i in range(1,MAX):
    fac[i] = (fac[i-1] * i) % MOD
ifac[MAX-1] = pow(fac[MAX-1],MOD-2,MOD)
for i in reversed(range(1,MAX)):
    ifac[i-1] = (ifac[i] * i) % MOD

def combinations(n, k):
    if k < 0 or n < k:
        return 0
    else:
        return (fac[n] * ifac[k] * ifac[n-k]) % MOD

N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

def f(A):
    ans = 0
    for i in range(K-1,N):
        ans += A[i]*combinations(i-1,K-1)
        ans %= MOD
    return ans

print((f(A) - f(reversed(A))) % MOD )



Fixed submission:
MAX = 600000
MOD = 10 ** 9 + 7
fac = [0] * MAX
ifac = [0] * MAX
fac[0] = 1
for i in range(1,MAX):
    fac[i] = (fac[i-1] * i) % MOD
ifac[MAX-1] = pow(fac[MAX-1],MOD-2,MOD)
for i in reversed(range(1,MAX)):
    ifac[i-1] = (ifac[i] * i) % MOD

def combinations(n, k):
    if k < 0 or n < k:
        return 0
    else:
        return (fac[n] * ifac[k] * ifac[n-k]) % MOD


N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
com = [0]
for i in range(N):
    com.append(A[i] + com[-1])
#print(com)
ans = 0
for i in range(K-2,N-1):
    ans += combinations(i,K-2) * (-(com[N-i-1]) + (com[N]-com[i+1]))
    #print(N-i-1,N,i+1)
    ans %= MOD
    #print(combinations(i,K-2) * (-(com[N-i-1]) + (com[N]-com[i+1])))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
val = []
prime = []
for i in range(2,100000):
    val.append(i)
while len(val) != 0:
    prime.append(val[0])
    val = [i for i in val if i % val[0] != 0]
#print(prime)
#print(val)

ans = 2
for i in prime:
    if i >= x:
        ans = i
print(ans)

Fixed submission:
x = int(input())
val = 0
ans = 0
for i in range(x, int(1e20)):
    if i % 2 == 0 and i !=2:
        continue
    for j in range(2,i+1):
        if i == j:
            val = 1         
        
        
        if i % j == 0:
            break

          
    if val == 1:
        ans = i
        break
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
psn = []
alis = []
for i in range(n):
    lis = []
    a = int(input())
    for j in range(a):
        lis.append(list(map(int, input().split())))
    alis.append(a)
    psn.append(lis)
#print(psn)
#print(a)


ans = []
for i in range(2 ** n):
    flag = [False] * n
    for j in range(n):
        if (i >> j) & 1:
            flag[j] = True
    #print(flag)
    hata = True
    for j in range(n):
        for k in range(len(psn[j])):
            if flag[j] == True:
                if flag[psn[j][k][0]-1] == True and psn[j][k][1] == 0:
                    hata = False
                if flag[psn[j][k][0]-1] == False and psn[j][k][1] == 1:
                    hata = False
            #print(flag[psn[j][k][0]-1])
    if hata == True:
        ans.append(flag.count(True))
    #print(hata)

print(max(ans))

Fixed submission:
n = int(input())
psn = []
alis = []
for i in range(n):
    lis = []
    a = int(input())
    for j in range(a):
        lis.append(list(map(int, input().split())))
    alis.append(a)
    psn.append(lis)
#print(psn)
#print(a)


ans = []
for i in range(2 ** n):
    flag = [False] * n
    for j in range(n):
        if (i >> j) & 1:
            flag[j] = True
    #print(flag)
    hata = True
    for j in range(n):
        for k in range(len(psn[j])):
            if flag[j] == True:
                if flag[psn[j][k][0]-1] == True and psn[j][k][1] == 0:
                    hata = False
                if flag[psn[j][k][0]-1] == False and psn[j][k][1] == 1:
                    hata = False
            #print(flag[psn[j][k][0]-1])
    if hata == True:
        ans.append(flag.count(True))
    #print(hata)

print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
MOD = int(1e9) + 7
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(60):
    cnt = 0
    for j in range(n):
        if a[j] >> i & 1 == 1:
            cnt += 1
    ans += (cnt * (n-cnt) * (2**i)) % MOD
ans %= MOD
print(ans)


Fixed submission:
MOD = int(1e9) + 7
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(60):
    cnt = 0
    for j in range(n):
        if a[j] >> i & 1 == 1:
            cnt += 1
    ans += (cnt * (n-cnt) * (2**i)) % MOD
ans %= MOD
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
import.math
for i in range(n):
  if int(i * 1.08) == n:
    print(i)
    exit()
  elif math.ceil(i * 1.08) == n:
    print(i)
    exit()
   

  
print(':(')

Fixed submission:
n = int(input())
import math
for i in range(50000):
  if math.floor(i*1.08) == n:
    print(i)
    exit()
   

  
print(':(')
Buggy python submission (verdict: Runtime Error):
s = input()
if s == 'SUN':
  print(7)
elif s == 'SAT':
  print(1)
elif s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s==  'WED':
  print(4)
elif s == 'THU':
  print(3)
elif s == 'FRI':
  print(2)= input()
 

Fixed submission:
s = input()
if s == 'SUN':
  print(7)
elif s == 'SAT':
  print(1)
elif s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s==  'WED':
  print(4)
elif s == 'THU':
  print(3)
else:
  print(2)

Buggy python submission (verdict: Runtime Error):
s = input()
if s = 'SUN':
  print(7)
elif s = 'SAT':
  print(1)
elif s = 'MON':
  print(6)
elif s = 'TUE':
  print(5)
elif s=  'WED':
  print(4)
elif s = 'THU':
  print(3)
elif s = 'FRI':
  print(2)

Fixed submission:
s = input()
if s == 'SUN':
  print(7)
elif s == 'SAT':
  print(1)
elif s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s==  'WED':
  print(4)
elif s == 'THU':
  print(3)
else:
  print(2)
Buggy python submission (verdict: Runtime Error):
from math import factorial
mod = int(1e9) + 7
x, y = map(int, input().split())

if (x + y) % 3 != 0:
    print(0)
    exit()

n = (x+y)//3
a = x - n
b = y - n
r = min(a, b)
val1 = factorial(a+b) % mod
val2 = (factorial(r) % mod * factorial((a+b)-r) % mod) % mod
print(val1 * pow(val2,mod-2,mod) % mod)

Fixed submission:
mod = int(1e9) + 7
x, y = map(int, input().split())

if (x + y) % 3 != 0:
    print(0)
    exit()

n = (x+y)//3
a = x - n
b = y - n
r = min(a, b)
if r < 0:
    print(0)
    exit()
val1 = 1
for i in range(a+b):
    val1 = (val1 * ((a+b) - i)) % mod
val2 = 1
for i in range(r):
    val2 = (val2 * (r-i)) % mod
for i in range(a+b-r):
    val2 = ((val2% mod) * ((a+b-r)-i)) % mod
# val1 = factorial(a+b) % mod
# val2 = (factorial(r) % mod * factorial((a+b)-r) % mod) % mod
print((val1 * pow(val2,mod-2,mod)) % mod)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a == 1 <= value < 10:
  if b == 1 <= value < 10:
    print(a * b)
  else:
    print('-1')
else:
  print('-1')

Fixed submission:
a, b = map(int, input().split())
c = [1,2,3,4,5,6,7,8,9]
if a in c and b in c:
  print(a*b)
else:
  print('-1')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a and b == 1<= value < 10:
  print(a * b)
else:
  print('-1')

Fixed submission:
a, b = map(int, input().split())
c = [1,2,3,4,5,6,7,8,9]
if a in c and b in c:
  print(a*b)
else:
  print('-1')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a and b = 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9:
  print(a * b)
else:
  print('-1')

Fixed submission:
a, b = map(int, input().split())
c = [1,2,3,4,5,6,7,8,9]
if a in c and b in c:
  print(a*b)
else:
  print('-1')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if l[i] < l[j] + l[k]:
                if l[j] < l[i] + l[k]:
                    if l[k] < l[i] + l[j]:
                        ans += 1
print(ans)


Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0
#print(l)
for i in range(n):
    for j in range(i+1,n):
        val = l[i]+l[j]
        ng = n
        ok = j
        while abs(ok - ng) > 1:
            mid = (ok+ng)//2
            if val > l[mid]:
                ok = mid
            else:
                ng = mid


        #print(i,j,ok,ng)

        ans += ok - j


print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    print(A.index(i+1) +1, end =' ')

Fixed submission:
N = int(input())
if N%2 ==0:
    print(0.5000000000)
else:
    print(((N // 2 )+1) /N)
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from math import ceil,sqrt
a, b = map(int, input().split())

g = gcd(a,b)

s = []
for i in range(2,g+1):
    while g % i == 0:
        g //= i
        s.append(i)
#print(g)
#print(s)
print(len(set(s))+1)

Fixed submission:
from fractions import gcd
from math import ceil,sqrt
a, b = map(int, input().split())

g = gcd(a,b)

s = set()
for i in range(2,ceil(sqrt(g))+1):
    while g % i == 0:
        g //= i
        s.add(i)
if g != 1:
    s.add(int(1e14))
#print(g)
#print(s)
print(len(s)+1)
Buggy python submission (verdict: Runtime Error):
S = input()
b = list(S)
a = b[0::2]
c = b[1::2]
d = len(b)
e = len(c)
cnt = 0
f = a.count('R' or 'U' or 'D')
g = c.count('L' or 'U' or 'D')
if f == d and e == g:
    print(Yes)
else:
    print(No)

Fixed submission:
S = input()
b = list(S)
a = b[0::2]
c = b[1::2]
d = len(a)
e = len(c)
cnt = 0
f = a.count('R')
g = a.count('U')
h = a.count('D')
i = f + g + h



j = c.count('L')
k = c.count('U')
l = c.count('D')
m = j + k + l



if i == d and m == e:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from math import ceil,sqrt
a, b = map(int, input().split())

g = gcd(a,b)

s = set()
for i in range(2,ceil(sqrt(g))+1):
    while g % i == 0:
        g //= i
        s.add(i)
if g != 1:
s.add(int(1e14))
#print(g)
#print(s)
print(len(s)+1)

Fixed submission:
from heapq import heapify, heappop, heappush

n, m = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
    a[i] *= -1
heapify(a)
#print(a)
for i in range(m):
    maxa = heappop(a)
    heappush(a, -(-maxa//2))
#print(a)
print(-(sum(a)))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))
while m != 0:
    maxa = max(a)
    for i in range(n):
        if a[i] == maxa:
            a[i] /= 2
            m -= 1

ans = 0
#print(a)
for i in range(n):
    ans += int(a[i])
print(ans)

Fixed submission:
from heapq import heapify, heappop, heappush

n, m = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
    a[i] *= -1
heapify(a)
#print(a)
for i in range(m):
    maxa = heappop(a)
    heappush(a, -(-maxa//2))
#print(a)
print(-(sum(a)))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
a.reverse()
maxa = a[0]
for i in range(m):
    a[0] = a[0] / 2
    a.sort()
    a.reverse()
ans = 0
#print(a)
for i in range(n):
    ans += int(a[i])
print(ans)

Fixed submission:
from heapq import heapify, heappop, heappush

n, m = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
    a[i] *= -1
heapify(a)
#print(a)
for i in range(m):
    maxa = heappop(a)
    heappush(a, -(-maxa//2))
#print(a)
print(-(sum(a)))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-(c-1) // a-1))

Fixed submission:
a,b,c = input()
d,e,f = input()
count = 0
if a == d:
    count+= 1
if b == e:
    count+= 1
if c == f:
    count+= 1
print(count)

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

c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-c // a-1)-1)

Fixed submission:
a,b,c = input()
d,e,f = input()
count = 0
if a == d:
    count+= 1
if b == e:
    count+= 1
if c == f:
    count+= 1
print(count)

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

c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-c // a-1))

Fixed submission:
a,b,c = input()
d,e,f = input()
count = 0
if a == d:
    count+= 1
if b == e:
    count+= 1
if c == f:
    count+= 1
print(count)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
count = 1

for i in range(20):
    if b > count:
        count += a-1
    else:
        break
c = -(-count // a)
if a == b:
    print(c + 1)
elif count // a >= 1:
    print(c)
else:
    print(0)

Fixed submission:
a,b,c = input()
d,e,f = input()
count = 0
if a == d:
    count+= 1
if b == e:
    count+= 1
if c == f:
    count+= 1
print(count)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
count = 1

for i in range(20):
    if b > count:
        count += a-1
    else:
        break
if -(-count // a) >= 1:
    print(-(-count // a))
else:
    print(0)

Fixed submission:
a,b,c = input()
d,e,f = input()
count = 0
if a == d:
    count+= 1
if b == e:
    count+= 1
if c == f:
    count+= 1
print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-(c-1 // a-1))

Fixed submission:
a, b = map(int, input().split())
print(-(-(b-1) // (a-1)))

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

c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-(c -1)// a-1)

Fixed submission:
a, b = map(int, input().split())
print(-(-(b-1) // (a-1)))

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

c = 1
for i in range(20):
    if b > c:

        c += a-1
    else:
        break
print(count / a-1)

Fixed submission:
a, b = map(int, input().split())
print(-(-(b-1) // (a-1)))

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

c = 1
for i in range(20):
    if b > c:

        c += a-1
    else:
        break
print(count / a-1)

Fixed submission:
a, b = map(int, input().split())
print(-(-(b-1) // (a-1)))

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
count = 1
 
for i in range(20):
    if b > count:
        count += a-1
    else:
        break
if -(-count // a) >= 1:
    print(-(-count // a))
else:
    print(0

Fixed submission:
a, b = map(int, input().split())
print(-(-(b-1) // (a-1)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
a = p

ans = []
for i in range(1,n+1):
  ans.append(i)

  

for i in range(n):
  for j in range(n):
    a[i] = p[j]
    a[j] = p[i]
    if a == ans:
      print('YES')
      exit()
    else:
      a = p
    print(p)    
      
      
      
    
print('NO')

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
cnt = 0
  
for i in range(n-1):
  if h[i] - h[i+1] >= 2:
    print('No')
    exit()
  elif h[i] - h[i+1] == 1:
    cnt += -1
  elif h[i] - h[i+1] <= -1:
    cnt = 0
  if cnt == -2:
    print('No')
    exit()
    
    
print('Yes')
Buggy python submission (verdict: Runtime Error):
cnt = 0
ans = 0

for i in range(n):
  cnt = b[i] - a[i]
  if cnt > 0:
    ans += a[i]
    if a[i+1] >= cnt:
      ans += cnt
      a[i+1] -= cnt
    else:
      ans += a[i+1]
      a[i+1] =0
      
    
  else:
    ans += b[i]

print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
cnt = 0
ans = 0

for i in range(n):
  cnt = b[i] - a[i]
  if cnt > 0:
    ans += a[i]
    if a[i+1] >= cnt:
      ans += cnt
      a[i+1] -= cnt
    else:
      ans += a[i+1]
      a[i+1] =0
      
    
  else:
    ans += b[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0] * (n+1)

i = n
while i > 0:
    cnt = 0
    for j in range(1, n+1):
        if i * j  > n+1:
            break
        cnt += ans[i*j]
    if cnt % 2 != a[i-1]:
        ans[i] = 1
    i -= 1
    #print(cnt)
print(ans.count(1))
for i in range(1,n+1):
    if ans[i] == 1:
        print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * (n+1)

i = n
while i > 0:
    cnt = 0
    for j in range(1, n+1):
        if i * j  > n:
            break
        cnt += ans[i*j]
    if cnt % 2 != a[i-1]:
        ans[i] = 1
    i -= 1
    #print(cnt)
print(ans.count(1))
for i in range(1,n+1):
    if ans[i] == 1:
        print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = [0] * (n+1)

i = n
while i > 0:
    cnt = ans[i:n+1].count(1)
    if cnt % 2 != a[i-1]:
        ans[i] = 1
    i -= 1
    #print(cnt)
print(ans.count(1))
for i in range(1,n+1):
    if ans[i] == 1:
        print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * (n+1)

i = n
while i > 0:
    cnt = 0
    for j in range(1, n+1):
        if i * j  > n:
            break
        cnt += ans[i*j]
    if cnt % 2 != a[i-1]:
        ans[i] = 1
    i -= 1
    #print(cnt)
print(ans.count(1))
for i in range(1,n+1):
    if ans[i] == 1:
        print(i)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n+1

i = n
while i > 0:
    cnt = 0
    for j in range(1, n):
        if i * j  >= n:
            break
        cnt += ans[i*j]
    if cnt % 2 != a[i-1]:
        ans[i] = 1
    i -= 1
    #print(cnt)
print(ans.count(1))
for i in range(n):
    if ans[i] == 1:
        print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * (n+1)

i = n
while i > 0:
    cnt = 0
    for j in range(1, n+1):
        if i * j  > n:
            break
        cnt += ans[i*j]
    if cnt % 2 != a[i-1]:
        ans[i] = 1
    i -= 1
    #print(cnt)
print(ans.count(1))
for i in range(1,n+1):
    if ans[i] == 1:
        print(i)
Buggy python submission (verdict: Runtime Error):
s = list((input())
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print('Bad')
else:
  print('Good')

Fixed submission:
s = list(input())
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print('Bad')
else:
  print('Good')

Buggy python submission (verdict: Runtime Error):
s = list(int(input()))
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print('Bad')
else:
  print('Good')

Fixed submission:
s = list(input())
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print('Bad')
else:
  print('Good')
Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = []
for i in range(N):
    lis.append(tuple(map(int, input().split())))
if N == 1:
    print(1)

dic = {}
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        val = (lis[i][0]-lis[j][0], lis[i][1]-lis[j][1])
        if val in dic:
            dic[val] += 1
        else:
            dic[val] = 1
#print(dic)
print(N-max(dic.values()))


Fixed submission:
N = int(input())
lis = []
for i in range(N):
    lis.append(tuple(map(int, input().split())))
if N == 1:
    print(1)
    exit()

dic = {}
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        val = (lis[i][0]-lis[j][0], lis[i][1]-lis[j][1])
        if val in dic:
            dic[val] += 1
        else:
            dic[val] = 1
#print(dic)
print(N-max(dic.values()))

Buggy python submission (verdict: Runtime Error):
N = int(input())
lis = []
for i in range(N):
    lis.append(tuple(map(int, input().split())))

dic = {}
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        val = (lis[i][0]-lis[j][0], lis[i][1]-lis[j][1])
        if val in dic:
            dic[val] += 1
        else:
            dic[val] = 1
#print(dic)
print(N-max(dic.values()))


Fixed submission:
N = int(input())
lis = []
for i in range(N):
    lis.append(tuple(map(int, input().split())))
if N == 1:
    print(1)
    exit()

dic = {}
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        val = (lis[i][0]-lis[j][0], lis[i][1]-lis[j][1])
        if val in dic:
            dic[val] += 1
        else:
            dic[val] = 1
#print(dic)
print(N-max(dic.values()))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = set()
for i in range(m):
    a.add(int(input()))
dp = [0] * (n+1)
dp[0] = 1
if not(1 in a):
    dp[1] = 1
if not(2 in a):
    dp[2] = 1
for i in range(2,n+1):
    if i-1 in a:
        dp[i] = dp[i-2]
        dp[i-1] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]
#print(dp)
print((dp[n])%1000000007)

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

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

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = set()
for i in range(m):
    a.add(int(input()))
dp = [0] * (n+1)
dp[0] = 1
if not(1 in a):
    dp[1] = 1
if not(2 in a):
    dp[2] = 1
for i in range(2,n+1):
    if i-1 in a:
        dp[i] = dp[i-2]
        dp[i-1] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]
print(dp)
print((dp[n])%1000000007)

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

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