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
"""
for stairs in range(1,11):
    print(stairs, calc_pattern(stairs))
"""
N,M=map(int,input().split())
A=[-1]
A.extend([int(input()) for m in range(M)])
A.append(N+1)
#print(A)
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:
        #print("{} ~ {}".format(A[m]+1, A[m+1]-1))
        #print(calc_pattern(A[m+1]-1 - (A[m]+1)))
        s*=calc_pattern(A[m+1]-1 - (A[m]+1))
        s%=1000000007
        #print(s)
print(int(s))
# 0~A[0]-1, A[0]+1~A[1]-1
# A の先頭に-1を入れれば、A[i]+1~A[i+1]-1 で統一できそう
