import math
from collections import deque
memo = deque([1])
mcnt = 1
def fact(x):
    global memo,mcnt
    if x == 0: return 1
    while x > mcnt:
        memo.append(memo[-1] * (mcnt + 1))
        mcnt += 1
    return memo[x-1]

CONST = 1000000007
n,m = map(int,input().split())
lis = []
prev = -1
for _ in range(m):
    a = int(input())
    if prev + 1 == a:
        print(0)
        exit()
    lis.append(a-prev-2)
    prev = a
lis.append(n-prev-1)


ans = 1
for v in lis:
    if v == 0: continue
    way = 0
    for two in range(v//2+1):
        one = v - two * 2
        comb = (fact(one+two) // (fact(one) * fact(two))) % CONST
        way = (way + comb) % CONST
    ans = (ans * way) % CONST
print(ans)

