const MODULO: u64 = 1_000_000_007;

fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim_right().to_owned()
}

type ReadType = u64;
fn to_vec(s: String, offset: ReadType) -> Vec<ReadType> {
    s.split_whitespace()
        .map(|s| s.parse::<ReadType>().unwrap() - offset)
        .collect()
}

fn to_tuple(s: String) -> (ReadType, ReadType) {
    let v = to_vec(s, 0 as ReadType);
    (v[0], v[1])
}

fn mul(a: u64, b: u64) -> u64 {
    (a * b) % MODULO
}

fn div(a: u64, b: u64) -> u64 {
    // fermat's little theorem
    let mut p = MODULO - 2;
    let mut val = b;
    let mut inv: u64 = 1;
    while p > 0 {
        if p & 1 == 1 {
            inv = mul(inv, val);
        }
        val = mul(val, val);
        p /= 2;
    }

    mul(a, inv)
}

fn factorial(n: u64) -> u64 {
    (0..n).fold(1, |st, i| mul(st, n - i))
}

fn permutation(n: u64, r: u64) -> u64 {
    (0..(n - r)).fold(1, |st, i| mul(st, n - i))
}

fn count(n: u64) -> u64 {
    let mut sum = 0;
    let two_step_max = n / 2;
    for two_step in 1..(two_step_max + 1) {
        let one_step = n - mul(two_step, 2);
        let step = one_step + two_step;
        sum += div(permutation(step, one_step), factorial(two_step));
    }
    let one_step_only_case = 1;
    sum + one_step_only_case
}

fn evaluate(n: u64, v: &Vec<u64>) -> u64 {
    if v.windows(2).any(|w| w[0] + 1 == w[1]) {
        return 0;
    }

    let mut val = v.windows(2).fold(
        1,
        |st, w| mul(st, count(w[1] - w[0] - 2)),
    );
    val = mul(val, count(v[0] - 1));
    val = mul(val, count(n - *v.last().unwrap() - 1));
    val
}

fn main() {
    let (n, m) = to_tuple(read_line());
    let mut v: Vec<u64> = (0..m).map(|_| read_line().parse().unwrap()).collect();
    v.sort();

    println!("{}", evaluate(n, &v) % MODULO);
}
