#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[allow(unused_macros)]
macro_rules ! vec_md { ( $ init : expr ; $ ( $ dim : expr ) ;* ) => { vec_md ! ( $ ( $ dim ) ;* => $ init ) } ; ( $ head : expr ; $ ( $ tail : expr ) ;* => $ init : expr ) => { vec ! [ vec_md ! ( $ ( $ tail ) ;* => $ init ) ; $ head ] } ; ( $ head : expr => $ init : expr ) => { vec ! [ $ init ; $ head ] } ; }

fn main() {
    input! {
        n: usize, m: usize,
        a: [usize; m]
    }

    let a_set = a .into_iter().collect::<std::collections::HashSet<_>>();
    let mut dp = vec_md![Co(0);n+1];
    dp[0] = Co(1);
    for i in 0..dp.len() {
        if i+1<dp.len() && !a_set.contains(&(i+1)) {
            let tmp = dp[i];
            dp[i+1] += tmp;
        }
        if i+2<dp.len() && !a_set.contains(&(i+2)) {
            let tmp = dp[i];
            dp[i+2] += tmp;
        }
    }
    println!("{}", dp[n]);
}

#[allow(dead_code)]
pub const M: u64 = 1_000_000_007;

#[allow(dead_code)]
use std::ops::*;
#[allow(dead_code)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Co(pub u64);
#[allow(dead_code)]
impl Co {
    pub fn pow(self, mut n: u64) -> Self {
        let mut a = self;
        let mut res = Co(1);
        while n > 0 {
            if n & 1 == 1 {
                res *= a;
            }
            a = a * a;
            n >>= 1;
        }
        res
    }
}
#[allow(dead_code)]
impl std::fmt::Display for Co {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "{}", self.0)
    }
}
#[allow(dead_code)]
impl Add for Co {
    type Output = Self;
    fn add(self, rhs: Self) -> Self {
        Co((self.0 + rhs.0) % M)
    }
}
#[allow(dead_code)]
impl AddAssign for Co {
    fn add_assign(&mut self, rhs: Self) {
        *self = *self + rhs;
    }
}
#[allow(dead_code)]
impl Div for Co {
    type Output = Self;
    fn div(self, rhs: Self) -> Self {
        Co(self.0 * modinv(rhs.0) % M)
    }
}
#[allow(dead_code)]
impl DivAssign for Co {
    fn div_assign(&mut self, rhs: Self) {
        *self = *self / rhs;
    }
}
#[allow(dead_code)]
impl Mul for Co {
    type Output = Self;
    fn mul(self, rhs: Self) -> Self {
        Co(self.0 * rhs.0 % M)
    }
}
#[allow(dead_code)]
impl MulAssign for Co {
    fn mul_assign(&mut self, rhs: Self) {
        *self = *self * rhs;
    }
}
#[allow(dead_code)]
impl Sub for Co {
    type Output = Self;
    fn sub(self, rhs: Self) -> Self {
        Co(sub_mod(self.0, rhs.0))
    }
}
#[allow(dead_code)]
impl SubAssign for Co {
    fn sub_assign(&mut self, rhs: Self) {
        *self = *self - rhs;
    }
}
#[allow(dead_code)]
fn sub_mod(a: u64, b: u64) -> u64 {
    let mut tmp = (a as i64 - b as i64) % M as i64;
    if tmp < 0 {
        tmp += M as i64;
    }
    tmp as u64
}
#[allow(dead_code)]
fn modinv(a_: u64) -> u64 {
    let m = M as i64;
    let mut a = a_ as i64;
    let mut b = m as i64;
    let mut u = 1;
    let mut v = 0;
    while b != 0 {
        let t = a / b;
        a -= t * b;
        std::mem::swap(&mut a, &mut b);
        u -= t * v;
        std::mem::swap(&mut u, &mut v);
    }
    u %= m;
    if u < 0 {
        u += m
    };
    u as u64
}

Measured memory_bytes: 8444