Buggy python submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(10000)

n, m = map(int, input().split())
broken = []
for i in range(m):
    broken.append(int(input()))
    if len(broken) > 1 and broken[-2] + 1 == broken[-1]:
        print(0)
        exit()
    

dp = [-float('inf')] * (n + 1)

def rec(i):
    global dp
    if dp[i] > -float('inf'):
        return dp[i]
      
    if i in broken:
        return 0
    
    if i >= n - 1:
        return 1
    
    dp[i] = rec(i + 1) + rec(i + 2)
    
    return dp[i]
            
print(rec(0)%1000000007)


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

mod = 10 ** 9 + 7

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

for i in reversed(range(n-1)):
    if broken[i]:
        dp[i] = (dp[i+1] + dp[i+2]) % mod
        
print(dp[0])

Buggy python submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(10000)

n, m = map(int, input().split())
broken = []
for i in range(m):
    broken.append(int(input()))
    if len(broken) > 1 and broken[-2] + 1 == broken[-1]:
        print(0)
        exit()
    

dp = [0] * (n + 1)

def rec(i):
    global dp
    if dp[i] > 0:
        return dp[i]
      
    if i in broken:
        return 0
    
    if i >= n - 1:
        return 1
    
    dp[i] = rec(i + 1) + rec(i + 2)
    
    return dp[i]
            
print(rec(0)%1000000007)


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

mod = 10 ** 9 + 7

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

for i in reversed(range(n-1)):
    if broken[i]:
        dp[i] = (dp[i+1] + dp[i+2]) % mod
        
print(dp[0])

Buggy python submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(2000)

n, m = map(int, input().split())
broken = []
for i in range(m):
    broken.append(int(input()))
    if len(broken) > 1 and broken[-2] + 1 == broken[-1]:
        print(0)
        exit()
    

dp = [0] * (n + 1)

def rec(i):
    global dp
    if dp[i] > 0:
        return dp[i]
    
    if i >= n - 1:
        return 1
    
    if i in broken:
        return 0
    
    dp[i] = rec(i + 1) + rec(i + 2)
    
    return dp[i]
            
print(rec(0)%1000000007)

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

mod = 10 ** 9 + 7

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

for i in reversed(range(n-1)):
    if broken[i]:
        dp[i] = (dp[i+1] + dp[i+2]) % mod
        
print(dp[0])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
broken = []
for i in range(m):
    broken.append(int(input()))
    if len(broken) > 1 and broken[-2] + 1 == broken[-1]:
        print(0)
        exit()
    

dp = [0] * (n + 1)
def rec(i):
    global dp
    if dp[i] > 0:
        return dp[i]
    
    if i >= n - 1:
        return 1
    
    if i in broken:
        return 0
    
    dp[i] = rec(i + 1) + rec(i + 2)
    
    return dp[i]
            
print(rec(0)%1000000007)

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

mod = 10 ** 9 + 7

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

for i in reversed(range(n-1)):
    if broken[i]:
        dp[i] = (dp[i+1] + dp[i+2]) % mod
        
print(dp[0])