import scala.io.StdIn

object Main extends App {
  val Array(n, m) = StdIn.readLine().split(" ").map(_.toInt)
  var a :Array[Int] = Array.empty
  var acc :BigInt = 0

  (1 to m).foreach { i =>
    a = a :+ StdIn.readLine().toInt
  }
  println(a.mkString(" "))
  def solve () :BigInt = {
    (1 to n).foreach { i =>
      if (! a.contains(i)) {
        if (i == 1) {
          acc = 1
        } else if (i == 2) {
          if (acc == 0) {
            acc = 1
          } else {
            acc = 2
          }
        } else {
          if (! a.contains(i - 1) && ! a.contains(i - 2)) {
            if (acc == 0) {
              acc = 1
            } else {
              acc = acc * 2
            }
          } else if (a.contains(i - 1) && a.contains(i - 2)) {
            return 0
          } 
        }

      } 
    }
    acc
  }

  println(solve() %   1000000007)
}
  

