#![allow(unused_imports)]
#[macro_use]
mod reader {






    #![allow(dead_code)]
    use std;
    macro_rules! read_line((  ) => {
                           {
                           let mut input = String :: new (  ) ; std :: io ::
                           stdin (  ) . read_line ( & mut input ) . unwrap (
                           ) ; input } } ;);
    pub fn read_to_vec<T: std::str::FromStr>() -> Vec<T> {
        read_line!().split_whitespace().map(|e|
                                                e.parse().ok().unwrap()).collect()
    }
    pub fn read_parse<T: std::str::FromStr>() -> T {
        read_line!().trim().parse().ok().unwrap()
    }
}
#[macro_use]
mod misc {
    #![allow(dead_code)]
    use std;
    #[macro_export]
    macro_rules! bind_from_vec((
                               $ ( $ variable : ident ) , + = $ vector : expr
                               ) => {
                               let mut v = $ vector . clone (  ) . into_iter (
                                ) ; $ (
                               let $ variable = v . next (  ) . unwrap (  ) ;
                               ) + } ;);
}
mod calc {
    #![allow(dead_code)]
    use std;
    macro_rules! impl_trait(( $ tr : ident for $ ( $ int : ty ) , + ) => {
                            $ ( impl $ tr for $ int {  } ) + } ;);
    pub trait Integer: Copy + Eq + Ord + std::ops::Add<Output = Self> +
     std::ops::AddAssign + std::ops::Sub<Output = Self> +
     std::ops::SubAssign + std::ops::Mul<Output = Self> +
     std::ops::MulAssign + std::ops::Div<Output = Self> +
     std::ops::DivAssign + std::ops::Rem<Output = Self> +
     std::ops::RemAssign + std::ops::BitAnd<Output = Self> +
     std::ops::BitAndAssign + std::ops::BitOr<Output = Self> +
     std::ops::BitOrAssign + std::ops::BitXor<Output = Self> +
     std::ops::BitXorAssign + std::ops::Shl<usize, Output = Self> +
     std::ops::ShlAssign<usize> + std::ops::Shr<usize, Output = Self> +
     std::ops::ShrAssign<usize> {
    }
    impl_trait! (Integer for isize , i8 , i16 , i32 , i64 , usize , u8 , u16 ,
                 u32 , u64);
    pub trait UnsignedIndex<I: Into<u64>>: std::ops::Index<usize> {
        type
        Output: Copy;
        fn nth(&self, n: I)
        -> <Self as UnsignedIndex<I>>::Output;
    }
    impl <I: Into<u64>, T: Copy> UnsignedIndex<I> for Vec<T> {
        type
        Output
        =
        <Self as std::ops::Index<usize>>::Output;
        fn nth(&self, n: I) -> <Self as UnsignedIndex<I>>::Output {
            self[n.into() as usize]
        }
    }
    pub struct Factorial<T: Integer> {
        pub modulo: T,
        factorial: Vec<T>,
        inverse: Vec<T>,
        fac_inv: Vec<T>,
    }
    impl Factorial<u64> {
        pub fn init(max_init: u64, prime: u64) -> Factorial<u64> {
            let mut instance =
                Factorial{modulo: prime,
                          factorial: vec!(1 , 1),
                          inverse: vec!(0 , 1),
                          fac_inv: vec!(1 , 1),};
            instance.renew_max(max_init);
            instance
        }
        pub fn fac(&self, n: u64) -> u64 { self.factorial.nth(n) }
        pub fn fac_inv(&self, n: u64) -> u64 { self.fac_inv.nth(n) }
        pub fn max(&self) -> u64 { (self.factorial.len() - 1) as u64 }
        pub fn renew_max(&mut self, mut max: u64) {
            let prime = self.modulo;
            let max_old = self.max();
            if max <= max_old {
                return;
            } else if max >= prime { max = prime - 1; }
            let factorial = &mut self.factorial;
            let mut pred;
            let inverse = &mut self.inverse;
            let mut rem_inv;
            let fac_inv = &mut self.fac_inv;
            let mut pred_finv;
            for i in (max_old + 1)..(max + 1) {
                pred = factorial.nth(i - 1);
                rem_inv = inverse.nth(prime % i);
                pred_finv = fac_inv.nth(i - 1);
                factorial.push(pred * i % prime);
                inverse.push(((rem_inv + i - 1) / i * prime -
                                  prime / i * rem_inv) % prime);
                fac_inv.push(pred_finv * inverse.nth(i) % prime);
            }
        }
    }
    pub fn combination(fac: &Factorial<u64>, n: u64, k: u64) -> Option<u64> {
        if n >= k {
            Some(fac.fac(n) * fac.fac_inv(k) % fac.modulo * fac.fac_inv(n - k)
                     % fac.modulo)
        } else { None }
    }
}
use reader::*;
use misc::*;
use calc::*;
fn main() {
    const MOD: u64 = 1000000000 + 7;
    bind_from_vec!(n , m = read_to_vec :: < u64 > (  ));
    let mut steps: Vec<u64> = Vec::new();
    let mut pred: u64 = 0;
    let mut input: u64;
    for _ in 0..m {
        input = read_parse();
        if let Some(diff) = (input - 1).checked_sub(pred) {
            steps.push(diff);
        } else { println!(0); return; }
        pred = input + 1;
    }
    steps.push(n - pred);
    let fac = Factorial::init(100000, MOD);
    println!("{}" , steps . iter (  ) . fold (
             1 , | x , diff | x * ( 0 .. ( diff + 2 ) / 2 ) . fold (
             0 , | y , two | (
             y + combination ( & fac , diff - two , two ) . unwrap (  ) ) %
             MOD ) % MOD ));
}


Measured memory_bytes: 10492