import sympy as sym 
def fib(n):
    x = sym.symbols('x', nonnegative=True, integer=True)
    Fib = 1 / sym.sqrt(5) * (((1+sym.sqrt(5))/2)**(n) - ((1-sym.sqrt(5))/2)**(n))
    result = Fib.subs(x, n) 
    result = sym.simplify(result) 
    return result
n,m = list(map(int, input("").split()))
a=[]
a.append(-1)
for i in range(m):   
    a.append(int(input()))
a.append(n+1)
out=1
c=10**9+7
for i in range(m+1):
    out*=int(fib(a[i+1]-a[i]-1))
out%=c
print(out)