import math
def calc_pattern(stairs):
    if stairs<=4:
        return stairs
    d=stairs//2+1
    l=[(math.factorial(i+(stairs-i*2))/math.factorial(i)/math.factorial(stairs-i*2))%1000000007  for i in range(d)]
    return (sum(l))%1000000007
N,M=map(int,input().split())
A=[-1]
A.extend([int(input()) for m in range(M)])
A.append(N+1)
s=1
for m in range(M+1):
    if A[m+1]==1 or A[m]==N-1:
        continue
    if A[m]+1==A[m+1]:
        print(0)
        exit()
    else:
		s*=calc_pattern(A[m+1]-1 - (A[m]+1))
        s%=1000000007
print(int(s))
