s=list(map(int,input().split()))
t=[int(input()) for i in range(s[1])]
list=[]
mod=1000000007
d=1
for k in range(1010):
  list.append(0)
def fib(x):
  list[0]=list[1]=0
  list[2]=list[3]=1
  for l in range(4,x+3):
    list[l]=list[l-1]+list[l-2]
fib(1000)
for j in range(s[1]+1):
  if j==0:
    d*=list[t[j]+1]
    d=d%mod
    e=t[j]
  elif j==s[1]:
    d*=list[s[0]-t[j-1]+1]
    d=d%mod
  else:
    d*=list[t[j]-t[j-1]]
    d=d%mod
print(d)