use std::io;
use std::str::FromStr;
use std::collections::HashMap;

fn input_int_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn main() {
    let (n, m) = input_int_tuple();
    let mut a_vec: Vec<u64> = Vec::new();
    for i in 0..m {
        let a: u64 = input();
        a_vec.push(a);
    }    

    let mut max_dist = a_vec[0];
    for i in 1..a_vec.len() {
        if a_vec[i as usize] - a_vec[i as usize - 1] > max_dist {
            max_dist = a_vec[i as usize] - a_vec[i as usize - 1];
        }
    }
    let fibonacci_vec = fibonacci(max_dist);

    let mut now = 0;
    let mut sum = 1;
    for a in &a_vec {
        let distance = *a - now;
        if distance == 0 {
            println!("0");
            return;
        }
        sum *= fibonacci_vec[(distance - 1) as usize];
        if sum > 1000000007 {
            sum %= 1000000007;
        }
        // println!("sum = {}", sum);
        now = *a + 1;
    }
    sum *= fibonacci_vec[(n - now) as usize];
    // println!("{:?}", a_vec);
    if sum > 1000000007 {
        sum %= 1000000007;
    }
    println!("{}", sum);
}

fn fibonacci(max: u64) -> Vec<u64> {
    let mut fibonacci_vec: Vec<u64> = Vec::new();
    for i in 0..max {
        if i == 0 || i == 1 {
            fibonacci_vec.push(1);
            continue;
        }        
        fibonacci_vec.push(fibonacci_vec[i as usize -1] + fibonacci_vec[i as usize -2]);
    }
    fibonacci_vec
}
