fn read() -> String {
  let mut buf = String::new();
  std::io::stdin().read_line(&mut buf).ok();
  buf
}

fn main() {
  let v: Vec<usize> = read()
    .split_whitespace()
    .map(|x| x.parse().unwrap())
    .collect();
  let (n, m) = (v[0], v[1]);

  let mut stairs: Vec<usize> = vec![1_usize; n + 1];
  for _ in 0..m {
    let i: usize = read().trim().parse().unwrap();
    stairs[i] = 0;
  }

  for i in 2..n + 1 {
    stairs[i] = stairs[i] * (stairs[i - 2] + stairs[i - 1]);
  }
  println!("{}", stairs[n] % 1_000_000_007);
}
