<?php

fscanf(STDIN, "%d %d", $n, $m);
$A = [];
for ($i = 0; $i < $m; ++$i) {
    fscanf(STDIN, "%d", $a); 
    $A[] = $a;
}
const MOD = 1000000007;

$broken = array_fill(0, $n, false);
for ($i = 0; $i < $m; ++$i) {
    $broken[$A[$i]] = true;
}

$dp = array_fill(0, $n + 2, 0);
$dp[$n] = 1;
for ($i = $n - 1; $i >= 0; --$i) {
    if ($broken[$i]) continue;
    $dp[$i] = $dp[$i + 1] + $dp[$i + 2];
}

echo $dp[0] % MOD;
