import math
N,M = map(int, input().split())
ans = 1
bro = list([])

def Comp (A , B):
    ans = math.factorial(A) // (math.factorial(A-B) * math.factorial(B))
    return ans

def Keisan (X):
    sum=0
    a = int(X//2+1)
    x = int(X)
    if X== -1:
        return 0

    for i in range(a):
        sum+= Comp(x-i , i)

    return sum


for i in range(M):
    bro.append(input())

bro.append(N+1) #最終段　＋１　をゴールとして設定


for i in range(len(bro)):
    if i == 0:
        a = int(bro[i])
        ans = ans*Keisan(a-1)
    else:
        a = int(bro[i])
        b = int(bro[i-1])
        ans = ans*Keisan(a-b-2)

ans = int(ans//(10**9+7))

print(ans)
