N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]

dp=[0]*(N)

for i in range(1,N+1):
    if i==1 and 1 not in a:
        dp[0]=1
    elif i==2:
        if 2 in a:
            dp[1]=0
        else:
            dp[1]+=dp[0]+1

    elif i not in a:
        dp[i-1]=dp[i-2]+dp[i-3]

print(dp[N-1]%1000000007)
    