chomp (my ($n, $m) = split / /, <STDIN>);
my @a;
for my $i (1..$m) {
  chomp (my $in = <STDIN>);
  push @a, $in;
}
my @b;
my ($c, $j) = (0, 0);
for my $i (0..$n) {
  if ($i == $a[$j]) {
    if ($c == 0) {
      print "0\n";
      exit;
    }
    $j++;
    push @b, $c;
    $c = 0;
  } else {
    $c++;
    push @b, $c if $i == $n;
  }
}
my @memo;
$memo[1] = 1;
$memo[2] = 1;
for my $i (3..$n) {
  $memo[$i] = $memo[$i - 1] + $memo[$i - 2];
}
my $ans = 1;
for my $i (@b) {
  $ans *= $memo[$i];
  $ans %= 1e9 + 7;
}
print "$ans\n";