import math
N, M = (int(i) for i in input().split())

list_a = list()
for i in range(M):
  list_a.append(int(input()))


curr = 0

list_pat = list()
for i in range(M+1):
  if i==M:
   dist=N
  else:
   dist=list_a[i]-1
  if dist-curr<=1:
   if dist==N:
    break
   else:
    if list_a[i]==1:
     curr=2
    else:
     list_pat.append(0)
#     print('break!')
     break
  else:
   diff_dist = dist-curr
#   print('diff_dist' + str(diff_dist))
   if diff_dist == 0:
    list_pat.append(1)
#    print('a')
   else:
    max_num_2 = diff_dist//2
    if max_num_2 == 0:
     list_pat.append(1)
#     print('b')
    else:
     list_pat_this = list()
     for num_2 in range(max_num_2+1):
      num_1 = diff_dist-num_2*2
#      print('num_1:'+str(num_1))
#      print('num_2:'+str(num_2))
      list_pat_this.append(math.factorial(num_1+num_2)/math.factorial(num_1)/math.factorial(num_2))
#     print(list_pat_this)
     list_pat.append(int(sum(list_pat_this)))
     if dist!=N: 
      curr = list_a[i]+1

#print(list_pat)
pat=1
for pat_this in list_pat:
 pat=pat*pat_this

print(pat%1000000007)
