MOD = 10**9+7
n,m = map(int,input().split())

f = [1,1]
for i in range(2, n):
    f.append(f[i-2]+f[i-1])

cur = 0
ans = 1
for i in range(m):
    a = int(input())
    if a==cur:
        print(0)
        exit(0)
    ans *= f[a-cur-1]
    ans %= MOD
    cur = a+1
ans *= f[n-cur]
ans %= MOD
print(ans)
