mod custom_lib;
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

pub fn read_n<T: FromStr>(n: u32) -> Vec<T> {
  read_n_logic::<T>(n, vec![])
}

pub fn read_n_logic<T: FromStr>(n: u32, mut a: Vec<T>) -> Vec<T> {
  match n {
    0 => a,
    _ => {
      a.push(read::<T>());
      read_n_logic(n - 1, a)
    }
  }
}

fn main() {
  let n = read::<usize>();
  let m = read::<u32>();
  let a = read_n::<usize>(m);

  let mut dp = vec![0; n + 3];
  let mut st = vec![true; n + 3];
  let md = 1_000_000_007;
  dp[0] = 1;
  if st[1] {
    dp[1] = 1;
  }

  for i in a {
    st[i] = false;
  }

  for idx in 2..n + 2 {
    if st[idx] {
      dp[idx] = (dp[idx - 1] + dp[idx - 2]) % md;
    } else {
      dp[idx] = 0
    }
  }

  let answer = dp[n] % md;
  println!("{}", answer);
}

