Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

MOD = 1000000007


def main():
    n, m = [int(i) for i in input().split()]
    a = {int(input()) for _ in range(m)}
    steps = [0] * (n + 1)
    steps[0] = 1

    for now in range(n):
        for next_ in range(now + 1, min(now + 2, n) + 1):
            if next_ not in a:
                steps[next_] += steps[now] % MOD
                steps[next_ %= MOD]
    print(steps[-1])


if __name__ == '__main__':
    main()


Fixed submission:
import sys
input = sys.stdin.readline

MOD = 1000000007


def main():
    n, m = [int(i) for i in input().split()]
    a = {int(input()) for _ in range(m)}
    steps = [0] * (n + 1)
    steps[0] = 1

    for now in range(n):
        for next_ in range(now + 1, min(now + 2, n) + 1):
            if next_ not in a:
                steps[next_] += steps[now] % MOD
                steps[next_] %= MOD
    print(steps[-1])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

MOD = 1000000007


def main():
    n, m = [int(i) for i in input().split()]
    a = [int(input()) for _ in range(m)]
    steps = [0] * (n + 1)
    steps[0] = 1

    for now in range(n):
        for next_ in range(now + 1, min(now + 2, n) + 1):
            if next_ not in a:
                steps[next_] += steps[now]
                steps[next_] %= MOD
    print(steps[-1])


if __name__ == '__main__':
    main()


Fixed submission:
import sys
input = sys.stdin.readline

MOD = 1000000007


def main():
    n, m = [int(i) for i in input().split()]
    a = {int(input()) for _ in range(m)}
    steps = [0] * (n + 1)
    steps[0] = 1

    for now in range(n):
        for next_ in range(now + 1, min(now + 2, n) + 1):
            if next_ not in a:
                steps[next_] += steps[now] % MOD
                steps[next_] %= MOD
    print(steps[-1])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

MOD = 1000000007

n, m = [int(i) for i in input().split()]
a = [int(input()) for _ in range(m)]
steps = [0] * (n + 1)
steps[0] = 1

for now in range(n):
    for next_ in range(now + 1, min(now + 2, n) + 1):
        if next_ not in a:
            steps[next_] += steps[now]
            steps[next_] %= MOD
print(steps[-1])



Fixed submission:
import sys
input = sys.stdin.readline

MOD = 1000000007


def main():
    n, m = [int(i) for i in input().split()]
    a = {int(input()) for _ in range(m)}
    steps = [0] * (n + 1)
    steps[0] = 1

    for now in range(n):
        for next_ in range(now + 1, min(now + 2, n) + 1):
            if next_ not in a:
                steps[next_] += steps[now] % MOD
                steps[next_] %= MOD
    print(steps[-1])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
MOD = 1000000007

n, m = [int(i) for i in input().split()]
a = [int(input()) for _ in range(m)]
steps = [0] * (n + 1)
steps[0] = 1

for now in range(n):
    for next_ in range(now + 1, min(now + 2, n) + 1):
        if next_ not in a:
            steps[next_] += steps[now]
            steps[next_] %= MOD
print(steps[-1])



Fixed submission:
import sys
input = sys.stdin.readline

MOD = 1000000007


def main():
    n, m = [int(i) for i in input().split()]
    a = {int(input()) for _ in range(m)}
    steps = [0] * (n + 1)
    steps[0] = 1

    for now in range(n):
        for next_ in range(now + 1, min(now + 2, n) + 1):
            if next_ not in a:
                steps[next_] += steps[now] % MOD
                steps[next_] %= MOD
    print(steps[-1])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
MOD = 1000000007

n, m = [int(i) for i in input().split()]
a = [int(input()) for _ in range(m)]
steps = [0] * (n + 1)
steps[0] = 1

for now in range(n):
    for next_ in range(now + 1, min(now + 2, n) + 1):
        if next_ not in a:
            steps[next_] += steps[now]
            steps[next_] %= MOD
print(steps[-1])



Fixed submission:
import sys
input = sys.stdin.readline

MOD = 1000000007


def main():
    n, m = [int(i) for i in input().split()]
    a = {int(input()) for _ in range(m)}
    steps = [0] * (n + 1)
    steps[0] = 1

    for now in range(n):
        for next_ in range(now + 1, min(now + 2, n) + 1):
            if next_ not in a:
                steps[next_] += steps[now] % MOD
                steps[next_] %= MOD
    print(steps[-1])


if __name__ == '__main__':
    main()