use proconio::{input, fastout};
use std::usize::MAX;

const MOD: usize = 1_000_000_007;

fn dp(step_cnt: &mut Vec<usize>, steps: usize) -> usize {
    if step_cnt[steps] != MAX { return step_cnt[steps]; }
    step_cnt[steps] = ( dp(step_cnt, steps-1) + dp(step_cnt, steps-2) ) % MOD;
    step_cnt[steps]
}

#[fastout]
fn main() {
    input! {
        n: usize, m: usize,
        broken: [usize; m],
    }

    let mut step_cnt: Vec<usize> = vec![MAX; n];
    step_cnt[0] = 1;
    step_cnt[1] = 1;
    step_cnt[2] = 2;

    let mut ans = 1;
    let mut last_idx = 0;
    let mut it = broken.iter();
    let f = it.next();
    match f {
        None => (),
        Some(1) => { last_idx = 1 },
        Some(i) => {
            ans = dp(&mut step_cnt, i-last_idx-1);
            last_idx = *i
        },
    }
    for i in it {
        if i-last_idx==1 { ans=0; break }
        ans = ans * dp(&mut step_cnt, i-last_idx-2) % MOD;
        last_idx = *i;
    }
    ans = ans * dp(&mut step_cnt, n-last_idx-1) % MOD;

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