INF = 1_000_000_007

N, M = list(map(int, input().split()))
A = [-1] + [int(input()) for _ in range(M)] + [N + 1]
res = 1
for i in range(M + 1):
    t = A[i + 1] - A[i] - 2
    if t < 0:
        res = 0
    else:
        if t <= 1:
            _t = 1
        elif t <= 3:
            _t = t
        else:
            _t = 2
            _b = (t - 1) // 2
            _a = t // 2 + 1
            _c = _a - _b
            b = 1
            for i in range(1, _b + 1):
                b *= i
            a = b
            for i in range(_b + 1, _a + 1):
                a *= i
            c = _a - _b
            for _ in range(_b):
                _t += a // b // c
                _a += 1
                a *= _a
                b //= _b
                _b -= 1
                _c += 1
                c *= _c
                _c += 1
                c *= _c
        res *= _t
print(res % INF)
