use std::io::*;
use std::str::FromStr;

const MOD: usize = 1_000_000_007;

fn main() {
    let n: usize = read();
    let m: usize = read();
    let a: Vec<usize> = (0..m).map(|_| read()).collect();

    let mut dp: Vec<usize> = vec![0; n+1];
    dp[0] = 1;
    dp[1] = 1;
    dp[2] = 2;
    for i in 3..n+1 {
        dp[i] = dp[i-1] + dp[i-2];
        dp[i] %= MOD;
        //println!("{}", dp[i]);
    }

    if m == 0 {
        println!("{}", dp[n]);
        return;
    }

    let mut ok = true;
    for i in 0..m-1 {
        if a[i+1] - a[i] == 1 {
            ok = false;
        }
    }
    if !ok {
        println!("0");
        return;
    }

    let mut ans: usize = 1;
    if a[0] > 1 {
        ans = dp[a[0]-1];
    }
    for i in 1..m {
        if a[i] > a[i-1] + 1 {
            ans *= dp[a[i] - a[i-1]-2];
            ans %= MOD;
        }
    }
    ans *= dp[n-1 - a[m-1]];
    ans %= MOD;
    println!("{}", ans);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}
