Buggy python submission (verdict: Runtime Error):
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]
k = 0
a, b = 0, 0
x = (10 ** 9 + 7)
for i in range(n):
    if i + 1 == hole[k]:
        a, b = 0, a
    else:
        if i == 0:
            a = 1
        elif i == 1:
            a, b = (a + 1) % x, a % x
        else:
            a, b = (a + b) % x, a % x
    if i + 1 >= hole[k] and k < m - 1:
        k += 1

    
print(a)

Fixed submission:
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]
k = 0
a, b = 0, 0
x = (10 ** 9 + 7)
for i in range(n):
    if m >= 1:
        if i + 1 == hole[k]:
            a, b = 0, a
        else:
            if i == 0:
                a = 1
            elif i == 1:
                a, b = (a + 1) % x, a % x
            else:
                a, b = (a + b) % x, a % x
        if i + 1 >= hole[k] and k < m - 1:
            k += 1
    else:
        if i == 0:
                a = 1
        elif i == 1:
            a, b = (a + 1) % x, a % x
        else:
            a, b = (a + b) % x, a % x
    
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]

a, b = 0, 0
x = (10 ** 9 + 7)

for i in range(n):
    if i + 1 in hole:
        a, b = 0, a
    else:
        if i == 0:
            a = 1
        elif i == 1:
            a, b = (a + 1) % x, a % x
        else:
            a, b = (a + b) % x, a % x
    
print(a)

Fixed submission:
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]
k = 0
a, b = 0, 0
x = (10 ** 9 + 7)
for i in range(n):
    if m >= 1:
        if i + 1 == hole[k]:
            a, b = 0, a
        else:
            if i == 0:
                a = 1
            elif i == 1:
                a, b = (a + 1) % x, a % x
            else:
                a, b = (a + b) % x, a % x
        if i + 1 >= hole[k] and k < m - 1:
            k += 1
    else:
        if i == 0:
                a = 1
        elif i == 1:
            a, b = (a + 1) % x, a % x
        else:
            a, b = (a + b) % x, a % x
    
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]

a, b = 0, 0

for i in range(n):
    if i + 1 in hole:
        a, b = 0, a
    else:
        if i == 0:
            a = 1
        elif i == 1:
            a, b = a + 1, a
        else:
            a, b = a + b, a
    

print(a % (10 ** 9 + 7))

Fixed submission:
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]
k = 0
a, b = 0, 0
x = (10 ** 9 + 7)
for i in range(n):
    if m >= 1:
        if i + 1 == hole[k]:
            a, b = 0, a
        else:
            if i == 0:
                a = 1
            elif i == 1:
                a, b = (a + 1) % x, a % x
            else:
                a, b = (a + b) % x, a % x
        if i + 1 >= hole[k] and k < m - 1:
            k += 1
    else:
        if i == 0:
                a = 1
        elif i == 1:
            a, b = (a + 1) % x, a % x
        else:
            a, b = (a + b) % x, a % x
    
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]

p =  [0] * n

for i in range(n):
    if i + 1 in hole:
        p[i] = 0
    else:
        if i == 0:
            p[0] = 1
        elif i == 1:
            p[1] = p[0] + 1
        else:
            p[i] = p[i-1] + p[i-2]

print(p[n-1] % (10 ** 9 + 7))

Fixed submission:
n, m = map(int,input().split())
hole = [int(input()) for _ in range(m)]
k = 0
a, b = 0, 0
x = (10 ** 9 + 7)
for i in range(n):
    if m >= 1:
        if i + 1 == hole[k]:
            a, b = 0, a
        else:
            if i == 0:
                a = 1
            elif i == 1:
                a, b = (a + 1) % x, a % x
            else:
                a, b = (a + b) % x, a % x
        if i + 1 >= hole[k] and k < m - 1:
            k += 1
    else:
        if i == 0:
                a = 1
        elif i == 1:
            a, b = (a + 1) % x, a % x
        else:
            a, b = (a + b) % x, a % x
    
print(a)