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
for i in A:
  if i+1 in A:
    flag = True
    
    
if flag :
  print(0)
elif not flag:
  A.append(N+1)
  A.sort()
  a_struct = []
  cut = 0
  for i in A:
    x = []
    for j in range(cut, i):
      x.append(j)
    a_struct.append(len(x)-1)
    cut = i+1


  sum_ = 1  

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

