
N,M = (int(i) for i in input().split())
a = [0] * M
mod = 1000000007
for i in range(M):
    a[i] = int(input())

dp = [1] * (N + 1)

flag = 0
for i in range(N-1):
    if i+1 in a and i in a:
        flag = 1
        break
    elif i+1 in a:
        dp[i+2] = dp[i]
    elif i in a:
        dp[i+2] = dp[i+1]
    else:
        dp[i+2] = (dp[i+1] + dp[i]) % mod

if flag == 1:
    print(0)
else:
    print(dp[N])
