import sys
import numpy as np
import itertools
import math

def patterns(length_n):
    n1 = length_n
    n2 = 0
    e = 0
    while(n1>-1):
        e+= math.factorial(n1+n2)/(math.factorial(n1)*math.factorial(n2))
        n1 = n1-2
        n2 = n2 + 1
    
    return e

N,M = input().split()
N = int(N)
M= int(M)

broken = []
broken.append(-1)

for i in range(M):
    broken.append(int(input()))
broken.append(N+1)

pattern = 1

for j in range(M+1):
    if (broken[j+1]-broken[j]-2==-1):
        print(0)
        exit()
    else:
        pattern =pattern * patterns(broken[j+1]-broken[j]-2)

print((pattern%1000000007))


