n, m = map(int, input().split())
aL = [int(input()) for _ in range(m)]
mod = 10**9+7
cant = 0
dp = [0]*(n+1)
dp[0] = 1
dp[1] = 0 if aL[0] == 1 else 1
if dp[1] == 0:
    pos = 1
else:
    pos = 0
for i in range(n-1):
    if pos < len(aL):
        if i+2 == aL[pos]:
            if dp[i+1] > 0:
                dp[i+2] = 0
                pos += 1
            else:
                cant = 1
                break
        else:
            dp[i+2] += (dp[i] + dp[i+1]) % mod
    else:
        dp[i+2] += (dp[i] + dp[i+1]) % mod
if cant == 1:
    print(0)
else:
    print(dp[n])