Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9+7
import sys
sys.setrecursionlimit(1000000)

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
di = {}
for i in a:
    di[i] = 1
dp = [0 for _ in range(N+1)]
dp[0] = 1

def dfs(num):
    if(num<0):
        return 0
    if(num==0):
        return 1
    if(num in di):
        return 0
    if(dp[num]==0):
        dp[num] = (dfs(num-1)+dfs(num-2))%mod
    return dp[num]

print(dfs(N))


Fixed submission:
mod = 10**9+7
import sys
sys.setrecursionlimit(10000000)

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
di = {}
for i in a:
    di[i]=1
dp = [0 for _ in range(N+1)]
dp[0] = 1
for i in range(N+1):
    if(i in di):
        continue
    if(i<N-1):
        if(i+2 not in di):
            dp[i+2]+=dp[i]
            dp[i+2]%=mod
    if(i<N):
        if(i+1 not in di):
            dp[i+1]+=dp[i]
            dp[i+1]%=mod
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9+7
import sys
sys.setrecursionlimit(1000000)

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
dp = [0 for _ in range(N+1)]
dp[0] = 1

def dfs(num):
    if(num<0):
        return 0
    if(num==0):
        return 1
    if(num in a):
        return 0
    if(dp[num]==0):
        dp[num] = (dfs(num-1)+dfs(num-2))%mod
    return dp[num]

print(dfs(N))


Fixed submission:
mod = 10**9+7
import sys
sys.setrecursionlimit(10000000)

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
di = {}
for i in a:
    di[i]=1
dp = [0 for _ in range(N+1)]
dp[0] = 1
for i in range(N+1):
    if(i in di):
        continue
    if(i<N-1):
        if(i+2 not in di):
            dp[i+2]+=dp[i]
            dp[i+2]%=mod
    if(i<N):
        if(i+1 not in di):
            dp[i+1]+=dp[i]
            dp[i+1]%=mod
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9+7
import sys
sys.setrecursionlimit(1000000)

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
dp = [0 for _ in range(N+1)]
dp[0] = 1
for i in range(N+1):
    if(i in a):
        continue
    if(i<N-1):
        if(i+2 not in a):
            dp[i+2]+=dp[i]
            dp[i+2]%=mod
    if(i<N):
        if(i+1 not in a):
            dp[i+1]+=dp[i]
            dp[i+1]%=mod
print(dp[N])


Fixed submission:
mod = 10**9+7
import sys
sys.setrecursionlimit(10000000)

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
di = {}
for i in a:
    di[i]=1
dp = [0 for _ in range(N+1)]
dp[0] = 1
for i in range(N+1):
    if(i in di):
        continue
    if(i<N-1):
        if(i+2 not in di):
            dp[i+2]+=dp[i]
            dp[i+2]%=mod
    if(i<N):
        if(i+1 not in di):
            dp[i+1]+=dp[i]
            dp[i+1]%=mod
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9+7

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
dp = [0 for _ in range(N+1)]
dp[0] = 1
for i in range(N+1):
    if(i in a):
        continue
    if(i<N-1):
        if(i+2 not in a):
            dp[i+2]+=dp[i]
    if(i<N):
        if(i+1 not in a):
            dp[i+1]+=dp[i]
print(dp[-1]%mod)


Fixed submission:
mod = 10**9+7
import sys
sys.setrecursionlimit(10000000)

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
di = {}
for i in a:
    di[i]=1
dp = [0 for _ in range(N+1)]
dp[0] = 1
for i in range(N+1):
    if(i in di):
        continue
    if(i<N-1):
        if(i+2 not in di):
            dp[i+2]+=dp[i]
            dp[i+2]%=mod
    if(i<N):
        if(i+1 not in di):
            dp[i+1]+=dp[i]
            dp[i+1]%=mod
print(dp[N])