<?php
fscanf(STDIN, "%d %d", $n, $m);
$a = array();
for($i=0;$i<$m;$i++){
  fscanf(STDIN, "%d", $a[$i]);
}
$count = 0;
$Fibonacci = [1, 1];
$count_array = array();
$number = 0;

for($k=0; $k<$m-1;$k++){
  if($a[$k] + 1 === $a[$k+1]){
    echo 0;
    return;
  }
}

for($j=2;$j<$n-1;$j++){
  $Fibonacci[$j] = $Fibonacci[$j-1] + $Fibonacci[$j-2];
}

for($p=0; $p<=$m;$p++){
  if($p == 0){
    if($a[$p] == 1){
      $number = 0;
    }
    else{
      $number = $a[$p] - 1;
    }
    $count_array[$p] = $Fibonacci[$number];
  }
  else if($p == $m){
    $number = $n - $a[$p-1] - 1;
    $count_array[$p] = $Fibonacci[$number];
  }
  else{
   	$number = $a[$p] - $a[$p-1] - 2;
    $count_array[$p] = $Fibonacci[$number];
  }
}

$count = array_product($count_array);
$answer = $count % 1000000007;

print_r($answer);
?>