import java.util.Scanner;

fun main(args: Array<String>){
  val sc = Scanner(System.`in`)
  var N = sc.nextInt()
  var M = sc.nextInt()
  
  val limit = 1000000007
  var total = 1
  var nowBroken = -1
  var wasBroken = -1
  while(M > 0){
    nowBroken = sc.nextInt()
    total *= patternCount(nowBroken, wasBroken)
    if(total >= limit){
      total %= limit
    }
    wasBroken = nowBroken
    M--
  }
  total *= patternCount(N + 1, wasBroken)
  if(total >= limit){
    total %= limit
  }
  println(total)
}

private fun patternCount(now: Int, was: Int) :Int{
  var diff = now - was - 1
  when(diff){
    0 -> return 0
    else -> return fibonacci(1, 1, diff, 2)
  }
}

tailrec fun fibonacci( a: Int, b: Int, n: Int, c: Int) : Int =
	if(c >= n){
    	a
    }else{
      fibonacci( a + b, a, n, c + 1)
    }
