For this Question: You are given N boxes that are kept in a straight line. You are also given M colors such that ( M &le; N
). You cannot change the position of boxes. Determine the number of ways to color the boxes such that if you select any M consecutive boxes then the color of each box is unique.
Since the number could be large, print the answer modulo 10<sup>9</sup> + 7
.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>CountBoxes()</b> that takes the integer N and M as parameter denoting the number of boxes and number of colours respectively.

<b>Constraints:</b>
1 &le; M, N &le; 10<sup>6</sup>Print the required answer in a new lineSample Input:-
2 2
Sample Output:-
2

Sample Input:-
4 3
Sample Output:-
6, I have written this Solution Code: class Solution {

    public static void CountBoxes(int n,int m) {
      
      long p = (long) (1e9 + 7);
		long a = 1;
		while (m > 0)
		{
			 a = (a * m) % p;
			 m--;
		}
		System.out.print(a);
       
    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?