def nCr(n, r):
    ans = 1
    for i in range(n,n-r,-1):
        ans = ans * i
    for i in range(1, r+1):
        ans = ans // i
    return ans

def count(n):
    if n == -1:
        return 0
    elif n == 0:
        return 1
    else:
        tmp = 0
        if n % 2 == 0:
            num = n // 2 + 1
        else:
            num = n // 2
        for i in range(num): #2歩で行く回数
            k = n - i #合計の歩数
            tmp += nCr(k, i)
        return tmp

N, M = list(map(int, input().split()))
a = []
current = 0
res = 1
for i in range(M):
    a = int(input())
    a_prev = a-1
    a_next = a+1
    leng = a_prev - current
    res = (res*count(leng))%(1e9+7)
    current = a_next

leng = N - current
res =(res*count(leng)) % (1e9+7)
print(int(res))
