Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
dp = [0] * (n+1)
dp[0] = 1
dp[1] = 1
for i in a:
    dp[i] = 0
for i in range(2, n+1):
    if i not in a:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007
print(dp[n])

Fixed submission:
import sys
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
ans = 1
step = [0] * (n+1)
step[0] = 1
step[1] = 1
for i in range(2, n+1):
    step[i] = (step[i-1] + step[i-2]) % 1000000007
if m == 0:
    print(step[n])
    sys.exit()
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        print("0")
        quit()
if m > 0:
    b[0] = a[0] - 1
    b[m] = n - a[-1] - 1   
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 2
for i in b:
    ans = ans * step[i] % 1000000007
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
dp = [0] * (n+1)
dp[0] = 1
dp[1] = 1
for i in a:
    dp[i] = 0
for i in range(2, n+1):
    if i not in a:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007
print(dp[n])

Fixed submission:
import sys
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
ans = 1
step = [0] * (n+1)
step[0] = 1
step[1] = 1
for i in range(2, n+1):
    step[i] = (step[i-1] + step[i-2]) % 1000000007
if m == 0:
    print(step[n])
    sys.exit()
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        print("0")
        quit()
if m > 0:
    b[0] = a[0] - 1
    b[m] = n - a[-1] - 1   
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 2
for i in b:
    ans = ans * step[i] % 1000000007
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
b[0] = a[0] - 1
b[m] = n - a[-1] - 1
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        print("0")
        quit()
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 2
ans = 1
step = [0] * (n+1)
step[0] = 1
step[1] = 1
for i in range(2, n+1):
    step[i] = (step[i-1] + step[i-2]) % 1000000007
for i in b:
    ans = ans * step[i] % 1000000007
print(ans)

Fixed submission:
import sys
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
ans = 1
step = [0] * (n+1)
step[0] = 1
step[1] = 1
for i in range(2, n+1):
    step[i] = (step[i-1] + step[i-2]) % 1000000007
if m == 0:
    print(step[n])
    sys.exit()
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        print("0")
        quit()
if m > 0:
    b[0] = a[0] - 1
    b[m] = n - a[-1] - 1   
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 2
for i in b:
    ans = ans * step[i] % 1000000007
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
b[0] = a[0] - 1
b[m] = n - a[-1] - 1
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 2
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        print("0")
        quit()
ans = 1
step = [0] * (n+1)
step[0] = 1
step[1] = 1
for i in range(2, n+1):
    step[i] = (step[i-1] + step[i-2]) % 1000000007
for i in b:
    ans = ans * step[i] % 1000000007
print(ans)  
        

Fixed submission:
import sys
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
ans = 1
step = [0] * (n+1)
step[0] = 1
step[1] = 1
for i in range(2, n+1):
    step[i] = (step[i-1] + step[i-2]) % 1000000007
if m == 0:
    print(step[n])
    sys.exit()
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        print("0")
        quit()
if m > 0:
    b[0] = a[0] - 1
    b[m] = n - a[-1] - 1   
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 2
for i in b:
    ans = ans * step[i] % 1000000007
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
b[0] = a[0] - 1
b[m] = n - a[-1] - 1
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 1
if 0 in b:
    print("0")  
else:         
    ans = 1
    step = [0] * (n+1)
    step[0] = 1
    step[1] = 1
    for i in range(2, n+1):
        step[i] = step[i-1] + step[i-2]
    for i in b:
        ans = ans * step[i]
    print(ans)  

Fixed submission:
import sys
n, m = map(int,input().split())
a = [int(input()) for i in range(m)]
b = [0] * (m+1)
ans = 1
step = [0] * (n+1)
step[0] = 1
step[1] = 1
for i in range(2, n+1):
    step[i] = (step[i-1] + step[i-2]) % 1000000007
if m == 0:
    print(step[n])
    sys.exit()
for i in range(m-1):
    if a[i] + 1 == a[i+1]:
        print("0")
        quit()
if m > 0:
    b[0] = a[0] - 1
    b[m] = n - a[-1] - 1   
if m >= 2:
    for i in range(m-1, 0, -1):
        b[i] = a[i] - a[i-1] - 2
for i in b:
    ans = ans * step[i] % 1000000007
print(ans)