#include using namespace std; long countArray(int n, int k, int x) { // Return the number of ways to fill in the array. long c=(n-2)*k/x; return c%10000000007; } int main() { int n; int k; int x; cin >> n >> k >> x; long answer = countArray(n, k, x); cout << answer << endl; return 0; }