from math import factorial
n, m = map(int, input().split())
broken = [-1]
x = 0
y = 0
for i in range(m):
    b = int(input())
    broken.append(b)
    if x == 1:
        if b == broken[i-1] + 1:
            print(0)
            y = 1
            break
    x = 1
broken.append(n+1)
anslist = []
for i in range(m+1):
    d = broken[i+1] - broken[i] - 1
    if d == 1 or d == 0:
        continue
    dd = d - 1
    if dd == 1:
        pass
    else:
        mskip = dd // 2
        d_way = 0
        for j in range(1, mskip+1):
            d_way += factorial(dd-j*2+ j) /(factorial(dd-j*2) * factorial(j))
    d_way += 1 
    anslist.append(int(d_way))
if d_way != 0:
    ans = 1
    for i in range(len(anslist)):
        ans *= anslist[i]
if y == 0:
    if ans == 0:
        print(1)
    else:
        print(int(ans%1000000007))