def acinput():
    return list(map(int,input().split(" ")))


N,M=acinput()
a=[0]*(N+1)
for i in range(M):
    a[int(input())]=1


M=1000000007

def solve(x):
    global dp,M
    if dp[x]>=0:
        return dp[x]

    res=0
    zeroflg=True
    if  a[x-1]==1:
        res+=solve(x-1)%M
        zeroflg=False
    if a[x-2]==1:
        res+=solve(x-2)%M
        zeroflg=False
    
    if zeroflg:
        return 0
    dp[x]=res
    return res

dp=[-1]*(N+1)
dp[0]=1
dp[1]=1

print(solve(N)%M)