#!/home/ryo/.pyenv/versions/anaconda3-2019.03/envs/hoge/bin/python
import sys
def fib(n):
    memo = [0] * (n+1)
    memo[0:2] = [0, 1]
    for i in range(2, n+1):
        memo[i] = memo[i - 1] + memo[i - 2]
    return memo

lim=10**9+7

N,M = map(int,input().split())
A=[]
for i in range(0,M):
    A.append(int(input()))
diff=[]
for i in range(0,len(A)-1):
    diff.append(A[i+1]-A[i]-1)
if 0 in diff:
    print(0)
    sys.exit()
else:
    max_n=diff.copy()
    max_n.append(A[0])
    max_n.append(N-A[-1])
    memo_fib=fib(max(max_n))
    #print(memo_fib)
    ans=memo_fib[A[0]]
    #print(ans)
    for i in diff:
        ans= ans * memo_fib[i] % lim
        #print(i, ans)
ans=ans*memo_fib[N-A[-1]] % lim
print(ans)