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 );

	assert( [ "1 0", "" ].parse.expand.solve == 1 );		// 追加ケース
}



import std.algorithm;
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[]( 2 + n );
	dp[ 1 ] = 1;
	foreach( a; as ) dp[ a + 1 ] = -1;
	for( auto i = 2L; i < dp.length; i++ )
	{
		if( dp[ i ] < 0 ) continue;							// この段は壊れているのでスキップ
		if( dp[ i - 2 ] < 0 && dp[ i - 1 ] < 0 ) break;		// 二段連続で壊れていて登れない
		dp[ i ] = ( max( dp[ i - 2 ], 0 ) + max( dp[ i - 1 ], 0 ) ) % MOD;
	}
	return dp[ $ - 1 ];
}
