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

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

if min(Ds)==0:
    print(0)
else:
    Fs = [fibo(n) for n in Ds]
    pattern = 1
    for f in Fs:
        pattern *= f
    print(pattern % 1000000007)