import numpy as np
import scipy.special as scm

def co(a,b):
    ans = 1
    for k in range(min(a-b,b)):
        ans = ans * (a-k) // (k+1)
    return ans

def comb(N):
    if N == 1:
        return 1
    else:
        sum0 = 0
        for i in range(N//2+1):
            sum0 = (sum0+int(scm.comb(N-i, i, exact=True)))%1000000007
        return sum0

def main():
    n, m = map(int, input().split())
    a = [-1]
    for i in range(m):
        a0 = int(input())
        a.append(a0)
    a.append(n+1)
    a = np.array(a)
    a = np.diff(a) -2
    # if a[0] == 0:
    #     a[0] = 1
    # if a[-1] == 0:
    #     a[-1] = 1
    if -1 in a:
        print(0)
        return
    sum1 = 1
    for i in a:
        sum1 = (sum1*comb(i))%1000000007
    print(int(sum1))
    return

main()
