
N, M = map(int, input().split())
X = [int(input()) for _ in range(M)]

MAX = 10 ** 5 + 1
MOD = 10 ** 9 + 7

# Factorial
fac = [0] * (MAX + 1)
fac[0] = 1
fac[1] = 1

# Inverse
inv = [0] * (MAX + 1)
inv[1] = 1

# Inverse factorial
finv = [0] * (MAX + 1)
finv[0] = 1
finv[1] = 1

for i in range(2, MAX + 1):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD


def comb(n, k):
    if n < k or k < 0:
        return 0
    return (fac[n] * finv[k] * finv[n - k]) % MOD


if any(X[i + 1] - X[i] == 1 for i in range(M - 1)):
    print(0)
else:
    X = [0] + X + [N]
    ans = 1
    for i in range(M + 1):
        diff = X[i + 1] - X[i] - 1
        tmp = 0
        for n in range(diff // 2 + 1):
            tmp += comb(diff - n, n)
            tmp %= MOD
        ans = ans * tmp % MOD
        print(diff, tmp)

    print(ans)
