Buggy python submission (verdict: Runtime Error):
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time
import sys

WARU = 1000000007

N, M = [ int(x) for x in input().split() ]
A = {}
for i in range(M):
    A[int(input())] = 1

ans = [None for i in range(N + 1)]
ans[0] = 1
ans[1] = 1
for a in A:
    ans[a] = 0

def steps(n):
    if ans[n] is not None:
        return ans[n]
    #print ("{} : {}".format(n, steps(n - 1) + steps(n - 2)))
    ans[n] = (steps(n - 1) + steps(n - 2)) % WARU
    return ans[n]

#print(ans)
print(steps(N))


Fixed submission:
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time
import sys

WARU = 1000000007

N, M = [ int(x) for x in input().split() ]
A = {}
for i in range(M):
    A[int(input())] = 1

ans = [None for i in range(N + 1)]
ans[0] = 1
ans[1] = 1
for a in A:
    ans[a] = 0

for i in range(N):
    n = i + 1
    if ans[n] is not None:
        continue
    ans[n] = (ans[n-2] + ans[n-1]) % WARU


print(ans[N])

Buggy python submission (verdict: Runtime Error):
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time
import sys

WARU = 1000000007

N, M = [ int(x) for x in input().split() ]
A = {}
for i in range(M):
    A[int(input())] = 1

ans = [None for i in range(N + 1)]
ans[0] = 1
ans[1] = 1 if not 1 in A else 0

def steps(n):
    if ans[n] is not None:
        return ans[n]
    if n in A:
        ans[n] = 0
        return ans[n]
    #print ("{} : {}".format(n, steps(n - 1) + steps(n - 2)))
    ans[n] = (steps(n - 1) + steps(n - 2)) % WARU
    return ans[n]

#print(ans)
print(steps(N))


Fixed submission:
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time
import sys

WARU = 1000000007

N, M = [ int(x) for x in input().split() ]
A = {}
for i in range(M):
    A[int(input())] = 1

ans = [None for i in range(N + 1)]
ans[0] = 1
ans[1] = 1
for a in A:
    ans[a] = 0

for i in range(N):
    n = i + 1
    if ans[n] is not None:
        continue
    ans[n] = (ans[n-2] + ans[n-1]) % WARU


print(ans[N])

Buggy python submission (verdict: Runtime Error):
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time
import sys

WARU = 1000000007

N, M = [ int(x) for x in input().split() ]
A = {}
for i in range(M):
    A[int(input())] = 1

ans = [None for i in range(N + 1)]
ans[0] = 1
ans[1] = 1 if not 1 in A else 0

def steps(n):
    if ans[n] is not None:
        return ans[n]
    if n in A:
        return 0
    #print ("{} : {}".format(n, steps(n - 1) + steps(n - 2)))
    ans[n] = (steps(n - 1) + steps(n - 2)) % WARU
    return ans[n]

#print(ans)
print(steps(N))


Fixed submission:
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time
import sys

WARU = 1000000007

N, M = [ int(x) for x in input().split() ]
A = {}
for i in range(M):
    A[int(input())] = 1

ans = [None for i in range(N + 1)]
ans[0] = 1
ans[1] = 1
for a in A:
    ans[a] = 0

for i in range(N):
    n = i + 1
    if ans[n] is not None:
        continue
    ans[n] = (ans[n-2] + ans[n-1]) % WARU


print(ans[N])