use std::io::stdin;

fn main() {
    let mut input = String::new();
    let _ = stdin().read_line(&mut input).unwrap();
    let n_m = input.trim().split(" ").map(|s| s.parse::<u32>().unwrap()).collect::<Vec<_>>();
    let N = n_m[0];
    let M = n_m[1];

    let a_m: Vec<u32> = (0..M).map(|_| {
        let mut input = String::new();
        let _ = stdin().read_line(&mut input).unwrap();
        input.trim().parse::<u32>().unwrap()
    }).collect();

    let mut step_list = vec![Some(0); N as usize];
    for a in a_m {
        step_list[ a as usize - 1] = None;
    }
    step_list[0] = if step_list[0].is_none() {None} else {Some(1)};
    step_list[1] = if step_list[1].is_none() {None} else {if step_list[0].is_none() {Some(1)} else {Some(2)}};

    for i in 2..N {
        step_list[i as usize] = step_list[i as usize].and_then(|_|{
            if step_list[i as usize -2].is_none() && step_list[i as usize - 1].is_none() {
                None
            } else {
                let acc =  [step_list[i as usize -2], step_list[i as usize - 1]].into_iter().filter_map(|&it| it).fold(0, |sum,ele| (sum + ele) % 1000000007);
                Some(acc)
            }
        })
    }
   println!("{}",if step_list[N as usize - 1].is_some() {step_list[N as usize -1].unwrap()} else {0}); 

}
