import math
n, m = map(int,input().split())
a = []
pam = -1

def fib(k):
    if k<0:
        return 0
    r=(((1+math.sqrt(5))/2)**(k+1)-((1-math.sqrt(5))/2)**(k+1))/math.sqrt(5)
    return round(r)


for i in range(0,m):
    am = int(input())
    a.append(am-pam)
    pam = am
a.append(n+1-pam)
count = 1
for aa in a:
    count = count * (fib(aa-2))%(1000000007)
print(count%(1000000007))