#[allow(unused_imports)]
use std::collections::HashMap;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

const MOD : usize = 1000_000_007;

fn main() {
    let nm = read_vec::<usize>();
    let n = nm[0];
    let m = nm[1];
    let mut amap = HashMap::new();
    let mut prev = 0;
    for _i in 0..m {
        let ai = read::<usize>();
        if ai <= prev {
            println!("0");
            return;
        }
        let key = ai - 1 - prev;
        let count = amap.entry(key).or_insert(0);
        *count += 1;
        prev = ai + 1;
    }
    let key = n - prev;
    let count = amap.entry(key).or_insert(0);
    *count += 1;

    let answer = solve(n, &amap);
    println!("{}", answer);
}

fn solve(n: usize, aset:&HashMap<usize, i32>) -> usize {
    if n <= 1 {
        return 1;
    }



    let mut c : usize= 1;
    let mut f0 :usize= 0;
    let mut f1 :usize = 1;
    for i in 1..n+1 {
        //println!("i={}", i);
        let f : usize = f0 + f1;
        if let Some(count) = aset.get(&i) {
            for _j in 0..*count {
                c *= f;
                c %= MOD;
            }
            //aset.remove(&i);
            //println!("  c -> {}", c);
        }
        f0 = f1;
        f1 = f % MOD;
    }
    
    return c;
}
