use strict;
use warnings;

my ($n, $m) = split /\s/, <>;

my @a = ();
foreach (1 .. $m) {
	chomp(my $a = <>);
	push @a, $a;
}
push @a, 999999;

if ($n == 1) {
	print 1, "\n";
	exit;
} elsif ($n == 2) {
	if (@a == 0) {
		print 2, "\n";
	} else {
		print 1, "\n";
	}
	exit;
}

my $a = shift @a;
my $p1 = 1;
my $p2 = 1;
if ($a == 1) {
	$p2 = 0;
	$a = shift @a;
}

foreach my $i (2 .. $n) {
	if ($a == $i) {
		$p1 = $p2;
		$p2 = 0;
		$a = shift @a;
	} else {
		($p1, $p2) = ($p2, $p1 + $p2);
	}
	
	if ($p1 == 0 and $p2 == 0) {
		last;
	}
	$p2 = $p2 % 1000000007;
}

print $p2, "\n";
