<?php
function array_last(array $array)
{
    return end($array);
}
fscanf(STDIN, '%d %d', $n, $m);
$arr = [];
for ($i = 0;$i < $m;$i++) {
    $arr[] = (int) trim(fgets(STDIN));
}
$tmp = 0;
$res = [1];
if ($arr[0] === 1) {
    $res[] = 0;
    $tmp++;
} else {
    $res[] = 1;
}

for ($i = 2;$i <= $n;$i++) {
    if ($tmp >= $m) {
        $res[] = $res[count($res) - 2]+array_last($res);
    } else if ($arr[$tmp] === $i) {
        $res[] = 0;
        $tmp++;
    } else {
        $res[] = $res[count($res) - 2]+array_last($res);
    }
}
echo end($res) % 1000000007 . PHP_EOL;