n,m  = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))
    
fib = [0,1,1,2]
for i in range(n-m):
    x = fib[i+3] + fib[i+2]
    fib.append(x)

a2 = [a[0],n-sum(a[-1:])]
for i in range(m-1):
    a2.append(a[i+1]-a[i]-1)
a3 = []
for i in range(len(a2)):
    a3.append(fib[a2[i]])
#ans = 1
import functools
import operator
ans = functools.reduce(operator.mul, a3)
#for i in range(len(a3)):
#    ans = ans * a3[i]
ans = ans%1000000007
print(ans)