use std::io;
use std::io::BufRead;

const MOD: u64 = 1_000_000_007;


fn main() {
    let stdin = io::stdin();
    let mut stdin = stdin.lock();
    
    let (n,m) = {
        let mut s = String::new();
        stdin.read_line(&mut s).unwrap();
        let mut s = s.trim().split_whitespace();
        (
            s.next().unwrap().parse::<usize>().unwrap(),
            s.next().unwrap().parse::<usize>().unwrap(),
        )
    };
    if m == 0 { println!("{}", fibonacci(n).last().unwrap()%MOD); return; }

    let a: Vec<usize> = {
        let mut a = Vec::with_capacity(m);
        for _ in 0..m {
            let mut s = String::new();
            stdin.read_line(&mut s).unwrap();
            a.push(
                s.trim().parse::<usize>().unwrap()
            );
        }
        a
    };


    let mut lag: Vec<usize> = vec![ a[0]-1 ];
    
    for i in 0..m-1 {
        let l = a[i+1] - a[i];
        if l == 1 { println!("0"); return; }
        lag.push( l-2 );
    }
    lag.push( n-a[m-1]-1 );

    let phi: Vec<u64> = fibonacci( *lag.iter().max().unwrap() );

    let mut prod: u64 = 1;
    for (i,l) in lag.iter().enumerate() {
        prod = prod * phi[*l] % MOD;
    }

    println!("{}", prod%MOD );
}



fn fibonacci( n: usize ) -> Vec<u64> {
    let mut phi: Vec<u64> = Vec::with_capacity(n+1);
    phi[0] = 1;
    phi[1] = 1;

    for i in 2..n+1 {
        let sum = phi[i-2] + phi[i-1];

        if sum >= MOD {
            phi.push( sum-MOD )
        } else {
            phi.push(sum);
        }
    }
    phi
}
