#![allow(unused_imports)]

use std::cmp::{max, min, Ordering};
use std::collections::*;
#[cfg(debug_assertions)]
include! {"./debug.rs"}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}

macro_rules! read {
    ([$t:ident] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ([$t:ident]) =>
        (rl().split_whitespace().map(|w| read_type!(w, $t)).collect::<Vec<_>>());
    (_, [$t:ident] ; $n:expr) =>
        ((0..$n).map(|_| read!(_, [$t])).collect::<Vec<_>>());
    (_, [$t:ident]) =>
        (rl().split_whitespace().skip(1).map(|w| read_type!(w, $t)).collect::<Vec<_>>());
    ($($t:ident),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ($t:ident) => (read_type!(rl(), $t));
    ($($t:ident),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(read_type!(w.next().unwrap(), $t)),*)
    }};
}

macro_rules! read_type {
    ($s:expr, chars) => {
        $s.chars().collect::<Vec<char>>()
    };
    ($s:expr, usize1) => {
        read_type!($s, usize) - 1
    };
    ($s:expr, $t:ty) => {
        $s.parse::<$t>().unwrap()
    };
}

fn rl() -> String {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

////////////////////////////////////////////////////////////////////////////////

fn main() {
    let (n, m) = read!(usize, usize);
    let mut a = read!(i32; m);
    a.insert(0, -1);
    a.push((n + 1) as i32);
    debug!(a);

    let b = (0..m + 1).map(|i| a[i + 1] - a[i] - 1).vec();
    debug!(b);

    let mut ans: i64 = 1;
    for x in b {
        ans *= if x == 0 {
            0
        } else if x <= 1 {
            1
        } else {
            let x = x as usize;
            let mut s = vec![0; x];
            s[0] = 1;
            s[1] = 1;
            for i in 2..x {
                s[i] = s[i - 2] + s[i - 1];
            }
            s[x - 1]
        };
        ans %= 1_000_000_007;
    }

    println!("{}", ans);
}
