import math
def calc_pattern(stairs):
    d=stairs//2
    l=[(math.factorial(i+(d-i)*2)/math.factorial(i)/math.factorial((d-i)*2))%1000000007  for i in range(d+1)]
    return (sum(l))%1000000007

#stairs=10
#print(calc_pattern(stairs))

# if A[i]+1==A[i+1]: print(0) exit()
N,M=map(int,input().split())
#A=[int(input()) for n in range(M)]
A=[-1]
A.extend([int(input()) for m in range(M)])
A.append(N+1)
#print(A)
# now=0, for a in A:
# 0~A[0]-1, A[0]+1~A[1]-1
# A の先頭に-1を入れれば、A[i]+1~A[i+1]-1 で統一できそう
s=1
for m in range(M+1):
    if A[m]+1==A[m+1]:
        print(0)
        exit()
    else:
        #print("{} ~ {}".format(A[m]+1, A[m+1]-1))
        #print(calc_pattern(A[m+1]-1 - (A[m]+1)))
        s=(s * calc_pattern(A[m+1]-1 - (A[m]+1)))%1000000007
print(int(s))


