N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0]*(N+1)
last_step= 0
for i in range(N+1):
    if i == 0:
        dp[0] = 1
    elif i == 1:
        if 1 == a[last_step]:
            dp[1] = 0
            if last_step +1 < M:
                last_step += 1
        else:
            dp[1] = 1
    else:
        if i  == a[last_step]:
            dp[i] = 0
            if last_step +1 < M:
                last_step += 1
        else:
            dp[i] = dp[i-1] + dp[i-2]
print(dp[-1]%1000000007)