unittest
{
	assert( [ "3" ].parse.expand.solve == 6 );
	assert( [ "10" ].parse.expand.solve == 3628800 );
	assert( [ "100000" ].parse.expand.solve == 457992974 );
}



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 n = input.front.to!( long );
	return tuple( n );
}

auto solve( long n )
{
	const MOD = 10 ^^ 9 + 7;
	
	auto ans = 1;
	for( auto i = 1L; i <= n; i++ )
	{
		ans = ( ans * i ) % MOD;
	}
	return ans;
}
