Problem p03013 (python)

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

  s=[0]*n
  if a[0]==1 and a[1] == 1:
    s[0] = 0
    s[1] = 0
  elif a[0] == 1:
    s[0] = 0
    s[1] = 1
  elif a[1] == 1:
    s[0] = 1
    s[1] = 0
  else:
    s[0] = 1
    s[1] = 2

  for i in range(2,n):
    #壊れている
    if a[i] == 1:
      s[i] = 0
    else:
      s[i] = s[i-1]+s[i-2]
  print(s[n-1]%1000000007)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = [0]*n
if m!=0:
  for i in range(m):
    a[int(input())-1] = 1

s=[0]*n
if a[0]==1 and a[1] == 1:
  s[0] = 0
  s[1] = 0
elif a[0] == 1:
  s[0] = 0
  s[1] = 1
elif a[1] == 1:
  s[0] = 1
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if a[i] == 1:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = [0]*n
if m!=0:
  for i in range(m):
    a[int(input())-1] = 1

s=[0]*n
if a[0] == 1:
  s[0] = 0
  s[1] = 1
elif a[1] == 1:
  s[0] = 1
  s[1] = 0
elif a[0]==1 and a[1] == 1:
  s[0] = 0
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if a[i] == 1:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = [0]*n
for i in range(m):
  a[int(input())-1] = 1

s=[0]*n
if a[0] == 1:
  s[0] = 0
  s[1] = 1
elif a[1] == 1:
  s[0] = 1
  s[1] = 0
elif a[0]==1 and a[1] == 1:
  s[0] = 0
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if a[i] == 1:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = [0]*n
for i in range(m):
  a[int(input())-1] = 1

s=[0]*n
if a[0] == 1:
  s[0] = 0
  s[1] = 1
elif a[1] == 1:
  s[0] = 1
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if a[i] == 1:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = [0]*m
for i in range(m):
  a[i] = int(input())-1
s=[0]*n

if a[0] == 0:
  s[0] = 0
  s[1] = 1
elif a[0] == 1:
  s[0] = 1
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if i in a:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = [0]*m
for i in range(m):
  a[i] = int(input())-1

s=[0]*n
if a[0] == 0:
  s[0] = 0
  s[1] = 1
elif a[1] == 1:
  s[0] = 1
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if i in a:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = [0]*m
for i in range(m):
  a[i] = int(input())-1


s=[0]*n
if 0 in a:
  s[0] = 0
  s[1] = 1
elif 1 in a:
  s[0] = 1
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if i in a:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a = [0]*m
for i in range(m):
  a[i] = int(input())-1


s=[0]*n
if 0 in a:
  s[0] = 0
  s[1] = 1
elif 1 in a:
  s[0] = 1
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if i in a:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)