import math
def cmb(n, r):
    return math.factorial(n)// ( math.factorial(n-r) * math.factorial(r) )



N,M = input().split()

N = int(N)
M = int(M)

a = []
ans = 1

for i in range(M):
    newa = int(input())
    a.append(newa)


for k in range(M-1):
    if (a[k+1] - a[k] == 1):
        ans = 0
            
    
    
for i in range(M + 1):
    

    if (i == 0):
        dan = a[i] - 1
    elif (i == M):
        dan = N - a[i - 1] - 1
    else:
        dan = a[i] - a[i - 1] - 2

    abletwo = (dan - (dan % 2)) // 2
    now = 0

    if (dan != 0):

        for j in range(abletwo + 1):

            now += cmb (dan - j , j )

    else:
        now = 1
        
    ans *= now
    

ans = ans % 1000000007
print (ans)
