def fibfunction(N): #各パートごとの経路の場合の数を求めるのはフィボナッチ数列
    fib=[1,1]
    if N >1:
        for i in range(N-1):
            fib.append(fib[i]+fib[i+1]) #1stepが1か2なので一つ前と二つ前の数を足せばよい
    elif N == -1:
        return 0
    else:
        return 1
    return fib[-1]

N, M = map(int, input().split())
alist = []
for i in range(M):
    alist.append(int(input()))

plist = [alist[0]-1,N-alist[-1]-1]
if M > 1:
    for j in range(M-1):
        p = alist[j+1]-alist[j]-2
        plist.append(p)

ulist = []
for l in range(len(plist)):
    q = fibfunction(plist[l])
    ulist.append(q)

ans = 1
for k in range(M+1):
    ans *= ulist[k]

ans = ans % 1000000007

print(ans)