Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = map(int, input().split())

    # i段目に到達するまでのルートの総数
    dp = [1] * (n + 1)

    a = [int(input()) for _ in range(m)]

    for i in range(1, n + 1):
        if i in a:
            dp[i] = 0
            continue

        dp[i] = dp[i - 1]
        if i >= 2:
            dp[i] += dp[i - 2]

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

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = map(int, input().split())

    # i段目に到達するまでのルートの総数
    dp = [1] * (n + 1)

    a = [int(input()) for _ in range(m)]

    for i in range(1, n + 1):
        if i in a:
            dp[i] = 0
            continue

        dp[i] = dp[i - 1]
        if i >= 2:
            dp[i] += dp[i - 2]

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

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Runtime Error):
def resolve():
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]
    dp = [-1] * (n + 1)

    for i in a:
        dp[i] = 0

    print(i_step(n, a, dp) % 1000000007)

# i段目にたどり着くまでの移動方法の総数
def i_step(i, a, dp):
    if i < 0:
        return 0

    if i == 0:
        return 1

    ret = 0
    if dp[i - 1] != -1:
        ret += dp[i - 1]
    else:
        ret += i_step(i - 1, a, dp)

    if i == 1:
        return ret

    if dp[i - 2] != -1:
        ret += dp[i - 2]
    else:
        ret += i_step(i - 2, a, dp)

    dp[i] = ret
    return ret
  
resolve()

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():


    from collections import deque

    n, m = map(int, input().split())
    ddp = deque(maxlen=2)

    li_broken = [0] * m
    for i in range(m):
        li_broken[i] = int(input())

    ddp.appendleft(0)
    ddp.appendleft(1)

    li_i = list(reversed(range(n)))

    for i in li_i:

        if i in li_broken:
            ddp.appendleft(0)

        else:
            ddp.appendleft(sum(ddp) % 1000000007)

    print(ddp[0])
    
resolve()


Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():


    from collections import deque

    n, m = map(int, input().split())
    ddp = deque(maxlen=2)

    li_broken = [0] * m
    for i in range(m):
        li_broken[i] = int(input())

    ddp.appendleft(0)
    ddp.appendleft(1)

    li_i = list(reversed(range(n)))

    for i in li_i:

        if i in li_broken:
            ddp.appendleft(0)

        else:
            ddp.appendleft(sum(ddp) % 1000000007)

    print(ddp[0])
    
resolve()

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():


    import sys
    input = sys.stdin.readline
    n, m = map(int, input().split())
    dp = [0] * (n + 2)

    li_broken = [0] * m
    for i in range(m):
        li_broken[i] = int(input())

    dp[n] = 1
    li_i = list(reversed(range(n)))

    for i in li_i:

        if i in li_broken:
            dp[i] = 0

        else:
            dp[i] = (dp[i+1] + dp[i+2]) % 1000000007

    print(dp[0])
    
resolve()

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
dp = [0] * (n + 2)

li_broken = [0] * m
for i in range(m):
  li_broken[i] = int(input())

dp[n] = 1
li_i = list(reversed(range(n)))

for i in li_i:

  if i in li_broken:
    dp[i] = 0

  else:
    dp[i] = (dp[i+1] + dp[i+2]) % 1000000007

      
print(dp[0])

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():


    import sys
    input = sys.stdin.readline
    n, m = map(int, input().split())
    dp = [0] * (n + 2)

    li_broken = [0] * m
    for i in range(m):
        li_broken[i] = int(input())

    dp[n] = 1
    li_i = list(reversed(range(n)))

    for i in li_i:

        if i in li_broken:
            dp[i] = 0

        else:
            dp[i] = (dp[i+1] + dp[i+2]) % 1000000007

    print(dp[0])
    
    
resolve()

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = map(int, input().split())
    li_broken = [int(input()) for _ in range(m)]
    dp = [0] * (n + 2)
    
    dp[n] = 1

    for i in reversed(range(n)):

        if i in li_broken:
            dp[i] = 0
            continue

        dp[i] = (dp[i+1] + dp[i+2]) % 1000000007

    print(dp[0])
    
resolve()

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = map(int, input().split())
    li_broken = [int(input()) for _ in range(m)]
    dp = [0] * (n + 2)

    for i in reversed(range(n + 1)):

        if i == n:
            dp[i] = 1
            continue

        if i in li_broken:
            dp[i] = 0
            continue

        dp[i] = (dp[i+1] + dp[i+2]) % 1000000007

    print(dp[0])
    
resolve()

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, m = map(int, input().split())
    li_broken = [int(input()) for _ in range(m)]
    dp = [0] * (n + 2)

    for i in reversed(range(n + 1)):

        if i == n:
            dp[i] = 1
            continue

        if i in li_broken:
            dp[i] = 0
            continue

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

    print(dp[0] % 1000000007)
    
resolve()

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)

Buggy python submission (verdict: Runtime Error):
def resolve():
    n, m = map(int, input().split())
    li_broken = [int(input()) for _ in range(m)]
    dp = [0] * (n + 2)

    for i in reversed(range(n + 1)):

        if i == n:
            dp[i] = 1
            continue

        if i in li_broken:
            dp[i] = 0
            continue

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

    print(dp[0] % 1000000007)（）
    
resolve()

Fixed submission:
def step(n):
  if n == 0:
      return 1
  steps = [0 for i in range(n + 2)]
  steps[1] = 1
  steps[2] = 2
  for i in range(3, n + 1):
    steps[i] = steps[i - 1] + steps[i - 2]
  return steps[n]

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

a.append(n)

sum = 1

for i in range(m + 1):

  if i == 0:
    sum *= step(a[i] - 1)
    continue
  
  elif i == m:
    sum *= step(a[m] - a[m-1] -1)
    
  elif a[i] - a[i-1] == 1:
    sum = 0
    break

  else:
    sum *= step(a[i] - a[i-1] -2)
    
if m == 0:
  sum = step(n)

print(sum % 1000000007)