import sys
from math import factorial

def combination(n,r):
    nCr = int(factorial(n) / factorial(r) / factorial(n - r))
    return(nCr)

n, m = [int(i) for i in input().split()]
a = [-1]
for i in range(m):
    a.append(int(input()))
    if a[-1] - a[-2] == 1:
        print(0)
        sys.exit()
a.append(n+1)
# print(a)

ans = 1
for i in range(len(a)-1):
    # print('i',i,ans)
    a_begin = a[i]
    a_end = a[i+1]
    # print(a_begin,a_end)
    num_stair = a_end - a_begin - 2
    max_num_two_up = num_stair // 2
    # print(num_stair,max_num_two_up)
    ans_tmp = 0
    for j in range(max_num_two_up+1):
        ans_tmp += combination(num_stair-j,j)
    ans *= ans_tmp

ans = ans % 1000000007
print(ans)
