def conv(a,b)
  if b > a/2
    b = a - b
  end
  ans = 1
  div = 1
  b.times do |i|
    ans *= a - i
    ans %= MOD
    div *= (i+1)
    div %= MOD
  end
  ans = ans * pow(div, MOD-2)
  ans % MOD
end

def pow(x,n)
  if n == 0
    1
  elsif n % 2 == 0
    pow(x*x%MOD, n/2) % MOD
  else
    x * pow(x, n-1) % MOD
  end
end

MOD = 10**9+7
n,m = gets.chomp.split(" ").map(&:to_i)
a = []
m.times do |i|
  a[i] = gets.to_i
end
count = 1
indi = 0
(m+1).times do |i|
  count_mid = 0
  if i == m
    step = n - indi
  else
    step = a[i]-1 - indi
  end
  step2 = step/2
  step1 = step%2
  while step2 > 0
    count_mid += conv(step2+step1,step1)
    count_mid %= MOD
    step2 -= 1
    step1 += 2
  end
  count_mid += 1
  count = count * count_mid
  count %= MOD
  if i != m
    indi = a[i]+1
  end
  if i > 0 && i != m
    if a[i]-1 == a[i-1]
      puts 0
      exit
    end
  end
end
puts count