<?php

//標準入力
class Scanner {
  private $arr = [];
  private $count = 0;
  private $pointer = 0;
  public function next() {
      if($this->pointer >= $this->count) {
          $str = trim(fgets(STDIN));
          $this->arr = explode(' ', $str);
          $this->count = count($this->arr);
          $this->pointer = 0;
      }
      $result = $this->arr[$this->pointer];
      $this->pointer++;
      return $result;
  }
  public function hasNext() {
      return $this->pointer < $this->count;
  }
  public function nextInt() {
      return (int)$this->next();
  }
  public function nextDouble() {
      return (double)$this->next();
  }
}

//標準出力
class out {
    public static function println($str = "") {
        echo $str . PHP_EOL;
    }
}



$sc = new Scanner();
$N = $sc->nextInt();
$M = $sc->nextInt();
$a = array();
$flag = true;
$col = 0;
$tmp = 0;
$sum = 0;
$ans = 1;

for($i = 1;$i <= $M; $i++){
    $a[] = $sc->nextInt();
}

for($i = 1;$i < $M; $i++){
    if($M === 1){
        break;
    }
    
    if($a[$i] - $a[$i-1] === 1){
        $flag = false;
        break;
    }
}

if($flag){
    for($i = 0; $i < count($a); $i++){
        $sum = fibona($a[$i] - $tmp);
        $ans = ($ans * $sum) % 1000000007;
        $tmp = $a[$i];
    }
    $sum = fibona($N - $tmp);
    $ans = ($ans * $sum) % 1000000007;
}else{
    $ans = 0;
}


echo $ans.PHP_EOL;



function fibona($n){
    if($n === 0){
        return 0;
    }

    if($n === 1){
        return 1;
    }
    return fibona($n -1) + fibona($n -2);
}
