def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result
  


  
  
N, M = map(int,input().split())
A = []
for i in range(M):
  a = int(input())
  A.append(a)
  
flag = False
A.append(N+1)
A.sort()
a_struct = []
cut = 0
#0~2, #4~6
for i in A:
  x = []
  for j in range(cut, i):
    x.append(j)
  a_struct.append(len(x)-1)
  cut = i+1

#print(x)
#print(a_struct)
sum_ = 1  

for i in a_struct:
  if i == -1:
    flag = True
  sho = int(i/2)
  amari = i%2
  ccc = 0
  for j in range(sho+1):
    count = 0
    if j == 0:
      ccc += 1
      #print('j')
      continue
    counter_1 =i-2*j 
    counter_2 = j
    count = cmb(counter_1+counter_2, counter_1)

    #print('count ', count)
    ccc += count
  sum_ *= ccc
    
#print(a_struct)
if flag:
  print(0)
elif not flag:
  print(sum_%1000000007)
#2 2