<?php

fscanf(STDIN, "%d %d", $n, $m);

$array = [];

$start = 0;
$sum = [];
for ($i = 1; $i <= $m; $i++) {
    $temp = 1;
    $tempb = 1;
    fscanf(STDIN, "%d", $array[$i]);
    if( $i != 1 && $array[$i] -1 == $array[$i-1]){
        echo 0;
        exit;
    }
    if($i != 1){

        $start = $array[$i-1] + 1;
    }else{
        $start = 0;
    }
    $stop = $array[$i] - 1;
    if($start == $stop){
        $sum[] = 1;
    }elseif($start + 1 == $stop ){
        $sum[] = 1;
    }else{
        for($j = 1; $j < ($stop - $start); $j++){
            $tempc = $tempb;
            $tempb = $temp;
            $temp = $temp + $tempc;

        }
        $sum[] = $temp;
    }


}
$start = $array[$m] + 1;
$stop = $n;
$tempc = 1;
$temp = 1;
$tempb = 1;
if($start == $stop){
    $sum[] = 1;
}elseif($start + 1 == $stop ){
    $sum[] = 1;
}else{
    for($j = 1; $j < ($stop - $start); $j++){
        $tempc = $tempb;
        $tempb = $temp;
        $temp = $temp + $tempc;
    }
    $sum[] = $temp;
}

$ans = 1;
foreach($sum as $value){
    $ans = $ans * $value;
}
echo ($ans % 1000000007);
