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

dp = [0] * (n + 1)
dp[0] = 1
MOD = 10 ** 9 + 7
for i in range(1, n + 1):
    if i in s:
        continue
    x = dp[i - 1]
    if i > 1:
        x += dp[i - 2]
    dp[i] = x % MOD

print(dp[n])


Fixed submission:
n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n+1)

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1

for i in range(n - 1):
    dp[i + 2] = dp[i + 1] + dp[i]
mae = 0
ans = 1
for i in s:
    if i == mae:
        ans=0
    else:
        ans *= dp[i - 1 - mae]

    mae = i + 1
print(ans % (10 ** 9 + 7))

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


dp = [0] * (n + 1)
dp[0] = 1
MOD = 10 ** 9 + 7
for i in range(1, n + 1):
    if i not in s:
        x = dp[i - 1]
        if i > 1:
            x += dp[i - 2]
        dp[i] = x % MOD

print(dp[n])


Fixed submission:
n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n+1)

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1

for i in range(n - 1):
    dp[i + 2] = dp[i + 1] + dp[i]
mae = 0
ans = 1
for i in s:
    if i == mae:
        ans=0
    else:
        ans *= dp[i - 1 - mae]

    mae = i + 1
print(ans % (10 ** 9 + 7))

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

dp = [0] * (n + 1)
dp[0] = 1
MOD = 10 ** 9 + 7
for i in range(1, n + 1):
    if i not in s:
        x = dp[i - 1]
        if i > 1:
            x += dp[i - 2]
        dp[i] = x % MOD

print(dp[n])


Fixed submission:
n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n+1)

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1

for i in range(n - 1):
    dp[i + 2] = dp[i + 1] + dp[i]
mae = 0
ans = 1
for i in s:
    if i == mae:
        ans=0
    else:
        ans *= dp[i - 1 - mae]

    mae = i + 1
print(ans % (10 ** 9 + 7))

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

dp = [0] * (n + 1)
dp[0] = 1

for i in range(1, n + 1):
    if i not in s:
        x = dp[i - 1]
        if i > 1:
            x += dp[i - 2]
        x %= 10 ** 9 + 7
        dp[i] = x

print(dp[n])


Fixed submission:
n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n+1)

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1

for i in range(n - 1):
    dp[i + 2] = dp[i + 1] + dp[i]
mae = 0
ans = 1
for i in s:
    if i == mae:
        ans=0
    else:
        ans *= dp[i - 1 - mae]

    mae = i + 1
print(ans % (10 ** 9 + 7))

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

dp = [0] * (n + 1)
dp[0] = 1

for i in range(1, n + 1):
    if i not in s:
        dp[i] += dp[i - 1]
        if i > 1:
            dp[i] += dp[i - 2]
            dp[i] = dp[i] % (10 ** 9 + 7)

print(dp[n])


Fixed submission:
n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n+1)

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1

for i in range(n - 1):
    dp[i + 2] = dp[i + 1] + dp[i]
mae = 0
ans = 1
for i in s:
    if i == mae:
        ans=0
    else:
        ans *= dp[i - 1 - mae]

    mae = i + 1
print(ans % (10 ** 9 + 7))

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

dp = [0] * (n + 1)
dp[0] = 1

for i in range(1, n + 1):
    if i not in s:
        dp[i] += dp[i - 1]
        if i > 1: dp[i] += dp[i - 2]
        dp[i] = dp[i] % (10 ** 9 + 7)

print(dp[n])


Fixed submission:
n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n+1)

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1

for i in range(n - 1):
    dp[i + 2] = dp[i + 1] + dp[i]
mae = 0
ans = 1
for i in s:
    if i == mae:
        ans=0
    else:
        ans *= dp[i - 1 - mae]

    mae = i + 1
print(ans % (10 ** 9 + 7))

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

dp = [0] * (n + 1)
dp[0] = 1

for i in range(1,n+1):
    if i not in s:
        dp[i] += dp[i - 1]
        if i > 1:dp[i] += dp[i - 2]

print(dp[n] % (10 ** 9 + 7))



Fixed submission:
n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n+1)

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1

for i in range(n - 1):
    dp[i + 2] = dp[i + 1] + dp[i]
mae = 0
ans = 1
for i in s:
    if i == mae:
        ans=0
    else:
        ans *= dp[i - 1 - mae]

    mae = i + 1
print(ans % (10 ** 9 + 7))