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

ans = [a[0]]

for i in range(M-1):
    ans.append(a[i+1]-a[i]-1)
        
def fibonacci(n):
    listf = [0]+[1]*n
    a, b = 1, 0
    for i in range(n-1):
        a, b = (a+b)%1000000007 , a
        listf[i+2] = a
    return listf

fib = fibonacci(N)

result = 1
for j in range(len(ans)):
    result = result * fib[ans[j]] % 1000000007

result = result * fib[(N - a[-1])] % 1000000007
    
print(result)
