use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();
    let m: usize = iterator.next().unwrap().parse().unwrap();

    let a: Vec<usize> = (0..m).map(|_| iterator.next().unwrap().parse().unwrap()).collect();

    let mut dp: Vec<usize> = vec![0; n + 2];
    dp[n] = 1;
    for i in (0..n).rev() {
        if a.contains(&i) {
            continue;
        }
        dp[i] = (dp[i + 1] + dp[i + 2]) % MOD;
    }

    return format!("{}", dp[0]);
}

const MOD: usize = 1_000_000_007;
