unittest
{
	assert( [ "6 1", "3" ].parse.expand.solve == 4 );
	assert( [ "10 2", "4", "5" ].parse.expand.solve == 0 );
	assert( [ "100 5", "1", "23", "45", "67", "89" ].parse.expand.solve == 608200469 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nm = input.front.split.to!( long[] );
	auto as = new long[]( nm[ 1 ] );
	foreach( ref a; as )
	{
		input.popFront;
		a = input.front.to!( long );
	}
	return tuple( nm[ 0 ], as );
}

auto solve( long n, long[] as )
{
	const MOD = 10L ^^ 9 + 7;
	
	auto dp = new long[]( 1 + n );
	dp[ 0 ] = 1;
	for( auto i = 1L; i < dp.length; i++ )
	{
		if( !as.empty && i == as.front )
		{
			as.popFront;
			continue;
		}
		if(      0 <= i - 2 && 0 < dp[ i - 2 ] ) dp[ i ] = ( dp[ i - 1 ] + dp[ i - 2 ] ) % MOD;
		else if( 0 <= i - 1 && 0 < dp[ i - 1 ] ) dp[ i ] = dp[ i - 1 ];
	}
	return dp[ $ - 1 ];
}
