import math
def fib(q):
    result = int(1 / math.sqrt(5) * (((1+math.sqrt(5))/2)**(q) - ((1-math.sqrt(5))/2)**(q)))
    return result
def o():
    n,m = list(map(int, input("").split()))
    a=[]
    a.append(-1)
    d=0
    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):
        d=a[i+1]-a[i]-1
        if d==0:
            return 0
        out*=int(fib(d))
        out%=c
    return int(out)
print(o())