from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
  


  
  
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)

