import sympy
def fibonacci(n):
    n = n+1
    x = sympy.symbols('x',nonnegative=True,integer=True)
    Fib=1/sympy.sqrt(5)*(((1+sympy.sqrt(5))/2)**(n-1)-((1-sympy.sqrt(5))/2)**(n-1))
    result=Fib.subs(x,n)
    result=result.evalf()
    return int(result)
def prod(array):
    ans = 1
    for i in range(len(array)):
        ans *= array[i]
    return ans
data = list(map(int,input().split()))
n = data[0]
m = data[1]
del data
a = [-1]
for i in range(m):#aの入力
    a.append(int(input()))
    if a[i] - a[i-1] == 1:#2段以上連続で穴が空いていたら0を出力して終了
            print(0)
            quit()
a.append(n+1)
b = []
for i in range(m+1):
    b.append(fibonacci(a[i+1]-a[i]-1))
print(prod(b)%1000000007)