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


Fixed submission:
[n,m] = [int(i) for i in input().split()]
a = []
for i in range(m):
    a.append(int(input()))
ok = [0] * (n+1)
for i in range(m):
    ok[a[i]] = 1
dp = [0] * (n+1)
dp[0] = 1
if n > 1:
    for i in range(1,n+1):
        if ok[i] != 1:
            if i == 1:
                dp[i] = 1
            else:
                dp[i] = (dp[i-2]+dp[i-1])%(10**9+7)
        else:
            dp[i] = 0
    print((dp[n])%(10 ** 9 + 7))
else:
    if 1 in a:
        print(0)
    else:
        print(1)

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


Fixed submission:
[n,m] = [int(i) for i in input().split()]
a = []
for i in range(m):
    a.append(int(input()))
ok = [0] * (n+1)
for i in range(m):
    ok[a[i]] = 1
dp = [0] * (n+1)
dp[0] = 1
if n > 1:
    for i in range(1,n+1):
        if ok[i] != 1:
            if i == 1:
                dp[i] = 1
            else:
                dp[i] = (dp[i-2]+dp[i-1])%(10**9+7)
        else:
            dp[i] = 0
    print((dp[n])%(10 ** 9 + 7))
else:
    if 1 in a:
        print(0)
    else:
        print(1)

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


Fixed submission:
[n,m] = [int(i) for i in input().split()]
a = []
for i in range(m):
    a.append(int(input()))
ok = [0] * (n+1)
for i in range(m):
    ok[a[i]] = 1
dp = [0] * (n+1)
dp[0] = 1
if n > 1:
    for i in range(1,n+1):
        if ok[i] != 1:
            if i == 1:
                dp[i] = 1
            else:
                dp[i] = (dp[i-2]+dp[i-1])%(10**9+7)
        else:
            dp[i] = 0
    print((dp[n])%(10 ** 9 + 7))
else:
    if 1 in a:
        print(0)
    else:
        print(1)

Buggy python submission (verdict: Runtime Error):
[n,m] = [int(i) for i in input().split()]
ls = []
tmp1 = -1
tmp2 = 0
checker = 0
ans = []
for i in range(m):
    tmp2 = int(input())
    ls.append(tmp2)
    if tmp2 - tmp1 == 1:
        checker = 1
        print(0)
        break
    tmp1 = tmp2
#i番目までの道の数
if n == 1:
    if 1 in ls:
        print(0)
    else:
        print(1)
else:
    for i in range(1,n+1):
        if i == 1:
            #1段目が使える時
            if 1 not in ls:
                ans.append(1)
            else:
                ans.append(0)
        elif i == 2:
            #2段目が使える時
            if 1 not in ls and 2 not in ls:
                ans.append(2)
            else:
                ans.append(1)
        else:
            if i in ls:
                ans.append(0)
            else:
                ans.append((ans[i-3]+ans[i-2])%(10**9+7))
if checker == 0:
    print(ans[n-1])


Fixed submission:
[n,m] = [int(i) for i in input().split()]
a = []
for i in range(m):
    a.append(int(input()))
ok = [0] * (n+1)
for i in range(m):
    ok[a[i]] = 1
dp = [0] * (n+1)
dp[0] = 1
if n > 1:
    for i in range(1,n+1):
        if ok[i] != 1:
            if i == 1:
                dp[i] = 1
            else:
                dp[i] = (dp[i-2]+dp[i-1])%(10**9+7)
        else:
            dp[i] = 0
    print((dp[n])%(10 ** 9 + 7))
else:
    if 1 in a:
        print(0)
    else:
        print(1)