import sys

readline = sys.stdin.readline

N, M = map(int, readline().split())
A = [int(readline()) for i in range(M)]
P = 1000000007

A = A + [N + 1]
ans = 1

current = 0

_count = 0
for a in A:
    diff = a - 1 - current
    current = a + 1

    if diff < 0:
        ans = 0
        break
    
    s = 1
    s_total = 1
    for x in range(1, diff // 2 + 1):
        _count += 1
        assert _count < 100000
        y = diff - x * 2
        s = s * (y + 1) * (y + 2) // (x + y + 1) // x
        s_total = s_total + s
    
    ans = (ans * s_total) % P

print(ans)