import java.util.Scanner

object Main {
  def main(args: Array[String]) {
    if (args.length > 0 && args(0) == "TEST") {
      println(test())
    } else {
      val input = io.Source.stdin.getLines().mkString("\n")
      println(solve(input).trim())
    }
  }

  val mod = 1000000007L


  def solve(input: String): String = {
    val s: Scanner = new Scanner(input)
    val n,m = s.nextInt
    val a = List.fill(m)(s.nextInt)
    var (s0, s1) = (1L, 1L)
    var st = 0L
    for (i <- 1 to n) {
      s1 = if (a.contains(i)) 0L else s1
      st = (s0 + s1) % mod
      s0 = s1
      s1 = st
    }
    s0.toString
  }

  val tests = List(
    """6 1
      |3
    """.stripMargin -> """4""",
    """10 2
      |4
      |5
    """.stripMargin -> """0""",
    """100 5
      |1
      |23
      |45
      |67
      |89
    """.stripMargin -> """608200469"""
  )

  def test(): String = tests.map { case (i, o) => (i.trim(), o.trim()) }
    .zipWithIndex.map {
    case ((input, outputExpect), i) =>
      val output = solve(input).trim()
      val tnum = i + 1
      s"test$tnum:" + (
        if (output == outputExpect) "Passed"
        else s"Failed\nexpect:\n$outputExpect\noutput:\n$output")
  }
    .mkString("\n")
}