text: Color all boxes in line such that every M consecutive boxes are unique | C # implementation of the above approach ; Function to return ( m ! % MOD ) ; Driver code
code: using System ; class GFG { const int MOD = 1000000007 ; static int modFact ( int n , int m ) { int result = 1 ; for ( int i = 1 ; i <= m ; i ++ ) result = ( result * i ) % MOD ; return result ; } public static void Main ( ) { int n = 3 , m = 2 ; Console . WriteLine ( modFact ( n , m ) ) ; } }