import math
N,M = map(int, input().split())
def C(a,b):
    return math.factorial(a+b)/(math.factorial(a)*math.factorial(b))
def pattern(n):
    ans = 0
    i = 0
    while n - 2*i >= 0:
        ans += C(n-i*2,i)
        i += 1
    return ans
ab = 0
ans = 1
mod = 10**9 + 7
for i in range(M):
    aa = int(input())
    if aa != 1:
        n = aa-ab-2
        ans *= pattern(n)
        ans = ans%mod
    ab = aa
if ab != N-1:
    n = N-ab-2
    ans *= pattern(n)
    ans = ans%mod
print(int(ans))