n,m =map(int,input().split())
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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 + combinations_count(wa12,k))
                    
        count = (count * tmp)%(10**9+7)
        before = a

print(count)
