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()); return; }

    let a: Vec<usize> = {
        let mut a = Vec::new();
        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: usize = a[0]+1;
    
    for i in 0..m-1 {
        let l = a[i+1] - a[i];
        
        if l == 1 {
            println!("0");
            return;
        }

        if l > lag { lag = l; }
    }
    if n-a[m-1] > lag {
        lag = n-a[m-1];
    }

    let phi: Vec<u64> = fibonacci( lag-2 );

    let mut prod: u64 = phi[a[0]-1];
    for i in 0..m-1 {
        println!("phi = {}", phi[ a[i+1] - a[i] - 2 ] );
        
        prod *= phi[ a[i+1] - a[i] - 2 ];
        // if i%3 == 0 {
        //     prod = prod % MOD;
        // }
    }

    println!("{}", ( prod * phi[n - a[m-1] - 1])%MOD);
}



fn fibonacci( n: usize ) -> Vec<u64> {
    let mut phi: Vec<u64> = vec![ 1, 1 ];

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

        // if i%16 == 0 {
        //     phi[i] %= MOD;
        //     phi[i-1] %= MOD;
        // }
    }
    phi
}
