n,m =map(int,input().split())

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

before = -1
count = 1
for i in range(m+1):
    if i == m:
        a = n+1
    else:
        a = int(input())
    sa = a-before-2
    
    if a-before == 1:
        print(0)
        exit()
    elif sa <= 1 :
        before = a    
        continue
    else:
        twonum = sa//2
        tmp = 1
        for k in range(1,twonum+1):
            wa12 = k + (sa-k*2)           
            tmp = (tmp + cmb(wa12,k))%(10**9+7)       
        count = (count * tmp)%(10**9+7)
        before = a

print(count)

