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

MOD = 10**9+7

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

res = 1
bef = -1
for a in a_list:
    res *= dp[a-bef]
    res %= MOD
    bef = a

res *= dp[N-bef+1]
res %= MOD

print(res)

    