object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val broken = Array.fill(n+1)(false)
  for (_ <- 1 to m) broken(sc.nextInt()) = true
  val dp = Array.fill(n+1)(-1L)
  dp(0) = 1L
  dp(1) = if (broken(1)) 0L else 1L
  for (i <- 2 to n) {
    if (broken(i)) {
      dp(i) = 0L
    } else {
      dp(i) = (dp(i-1) + dp(i-2)) % 1000000007
    }
  }
  println(dp.last)
}
