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

MOD = 10**9+7

dp = [0] * (10**5 + 3)
dp[1] = 0
dp[2] = 1
dp[3] = 2
for i in range(3, len(dp)):
    dp[i] = dp[i-1] + dp[i-2] 

res = 1
if M > 0:
    bef = -1
    for a in a_list:
        res *= dp[a-bef]
        res %= MOD
        bef = a
else:
    bef = 0
res *= dp[N-bef+1]
res %= MOD

print(res)

    