N,M = map(int, input().split())
A = [0]*M
for i in range(M):
    A[i] = int(input())

L = A[0]+2
if L < N - A[M-1]:
    L = N - A[M-1]
for i in range(M-1):
    L1 = A[i+1]-A[i]
    if L1 > L:
        L = L1
        
x = [0]*L
x.insert(0,0)
x.insert(1,1)
for i in range(L-2):
    x[i+2] = x[i+1] + x[i]
    
S = x[A[0]] * x[N - A[M-1]]
for i in range(M-1):
    S *= x[A[i+1]-A[i]-1]
    
print(S%1000000007)