from math import factorial as fac
N,M = map( int, input().split() )
break_list = []
for i in range(M):
    break_list.append( int( input() ) )
break_list.append( N + 1 )
start = 0
ans = 1
k = 1
for i in break_list:
    sum_c = 0
    end = i - 1
    if start > end:
        k = -1
    step_1 = end - start
    step_2 = int( ( end - start ) / 2 )
    for j in range(step_2 + 1):
        k = step_1 - 2 * j
        sum_c += fac(k + j) // ( fac(j) * fac(k) )
    ans *= sum_c
    start = i + 1
    
if k == 1:
    print( ans % 1000000007 )
else:
    print(0)