N, M = map(int, input().split())
As = []
for i in range(M):
    As.append(int(input()))
    
Ds = []
for i in range(M):
    if i==0:
        Ds.append(As[0])
    else:
        Ds.append(As[i]-As[i-1])
Ds.append(N-As[-1])

def fibo(n):
    if n==1:
        return 1
    elif n==2:
        return 2
    S = [1, 2]
    for i in range(2, n):
        S.append(S[-2]+S[-1])
    return S[-1]

Fs = [fibo(n) for n in Ds]

pattern = 1
for f in Fs:
    pattern *= f

print(f % 1000000007)