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

P = 1000000007

dp = [0]*(N+1)

if 1 in List:
    dp[1] = 0
    if 2 in List:
        dp[2] = 0
    else:
        dp[2] = 1
else:
    dp[1] = 1
    if 2 in List:
        dp[2] = 0
    else:
        dp[2] = 2

for i in range(2, N):
    if i+1 in List:
        dp[i+1]=0
    else:
        if i in List:
            dp[i+1] = dp[i-1]%P
        else:
            dp[i+1] = (dp[i]+dp[i-1])%P
        
print(dp[N])