use std::io::*;
use std::str::FromStr;
use std::vec::Vec;
use std::i32;

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

fn calc_fib(max: i32) -> Vec<i64> {
    let mut ret = Vec::with_capacity(max as usize);
    ret.push(1 as i64);
    ret.push(1 as i64);
    let max2 = max as usize;
    let mod_num = 10i64.pow(9) + 7;
    let mut i: usize = 2;
    while i < max2 {
        let v1 = ret[i - 1];
        let v2 = ret[i - 2];
        ret.push((v1 + v2) % mod_num);
        i += 1;
    }
    return ret
}

fn solve(n: i32, a: Vec<i32>) -> i64 {
    let fib = calc_fib(10010);
    let count = a.len();
    if count == 0 {
        return fib[n as usize];
    }
    let mod_num = 10i64.pow(9) + 7;
    let mut total = fib[(a[0] - 1) as usize];

    for i in 0..count-1 {
        let diff = a[i + 1] - a[i];

        if diff <= 1 {
            return 0
        }
        total = total * fib[(diff - 2) as usize] % mod_num;
    }
    let diff = n - a[count - 1] - 1;
    if diff > 0 {
        total = total * fib[diff as usize] % mod_num;
    }
    return total
}

fn main() {
    let n: i32 = read();
    let m: i32 = read();
    let a = (0..m).map(|_| read::<i32>()).collect::<Vec<_>>();
    let ans = solve(n, a);
    println!("{}", ans);
}
