#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int)1e9 + 23111992;
const long long LINF = (long long)1e18 + 23111992;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return val < a ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
inline unsigned long long isqrt(unsigned long long k) {
  unsigned long long r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
inline long long icbrt(long long k) {
  long long r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(long double x, long double y) { return sign(x - y); }
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int mrand() { return abs((int)mt()); }
void chemthan() {
  int n, k, m;
  cin >> n >> k >> m;
  if (k == 1 || k == n) {
    cout << n << "\n";
    return;
  }
  auto mul_vec = [&](vector<int> v, int k) {
    for (int& x : v) {
      x = mult(x, k);
    }
    return v;
  };
  auto add_vec = [&](vector<int> v1, vector<int> v2) {
    assert(int((v1).size()) == int((v2).size()));
    for (int i = (0); i < (int((v1).size())); ++i) {
      addmod(v1[i], v2[i]);
    }
    return v1;
  };
  auto sub_vec = [&](vector<int> v1, vector<int> v2) {
    assert(int((v1).size()) == int((v2).size()));
    for (int i = (0); i < (int((v1).size())); ++i) {
      submod(v1[i], v2[i]);
    }
    return v1;
  };
  vector<vector<vector<int>>> dp(m, vector<vector<int>>(m, vector<int>(m)));
  vector<vector<vector<int>>> f(m, vector<vector<int>>(m, vector<int>(m)));
  for (int i = (1); i < (m - 1); ++i) {
    dp[1][i][i] = 1;
    dp[0][i][0] = dp[i][0][0] = i + 1;
  }
  for (int s = (0); s < (2); ++s) {
    for (int a = (0); a < (s + 1); ++a) {
      int b = s - a;
      if (b) {
        f[a][b] = add_vec(f[a][b - 1], dp[a][b]);
      } else {
        f[a][b] = dp[a][b];
      }
    }
  }
  for (int s = (2); s < (m); ++s) {
    for (int a = (2); a < (s); ++a) {
      int b = s - a;
      int x = mult(s, inv(mult(m, s - 1)));
      int y = (1 - mult(s, inv(m)) + MOD) % MOD;
      int p = mult(a, inv(s + 1));
      int q = mult(b + 1, inv(s + 1));
      dp[a][b] = dp[a - 1][b];
      dp[a][b] = sub_vec(dp[a][b], mul_vec(f[b][a - 2], x));
      dp[a][b] = sub_vec(dp[a][b], mul_vec(f[a - 1][b - 1], x));
      dp[a][b] = mul_vec(dp[a][b], inv(y));
      dp[a][b] = sub_vec(dp[a][b], mul_vec(dp[a - 1][b + 1], q));
      dp[a][b] = mul_vec(dp[a][b], inv(p));
    }
    for (int a = (0); a < (s + 1); ++a) {
      int b = s - a;
      if (b) {
        f[a][b] = add_vec(f[a][b - 1], dp[a][b]);
      } else {
        f[a][b] = dp[a][b];
      }
    }
  }
  auto gauss = [&](vector<vector<int>>& a) {
    int n = int((a).size());
    for (int i = (0); i < (n); ++i) {
      if (!a[i][i]) {
        for (int j = (i + 1); j < (n); ++j)
          if (a[j][i]) {
            for (int k = (0); k < (n + 1); ++k) addmod(a[i][k], a[j][k]);
            break;
          }
      }
      assert(a[i][i]);
      int t = inv(a[i][i]);
      for (int j = (0); j < (n + 1); ++j) a[i][j] = mult(a[i][j], t);
      for (int j = (0); j < (n); ++j)
        if (j ^ i) {
          t = a[j][i];
          for (int k = (0); k < (n + 1); ++k) submod(a[j][k], mult(a[i][k], t));
        }
    }
  };
  vector<vector<int>> mat(m - 2, vector<int>(m - 1));
  int ptr = 0;
  for (int i = (2); i < (m - 1); ++i)
    if (i % 2 == 0) {
      vector<int> v = dp[i][1];
      submod(v[i], 1);
      for (int j = (1); j < (m); ++j) {
        mat[ptr][j - 1] = v[j];
      }
      submod(mat[ptr][m - 2], v[0]);
      ptr++;
    }
  for (int i = (1); i < (m - 1); ++i)
    if (ptr < m - 2) {
      vector<int> v = dp[i][m - i - 1];
      v = sub_vec(v, mul_vec(f[i][m - i - 2], inv(m - 1)));
      v = sub_vec(v, mul_vec(f[m - i - 1][i - 1], inv(m - 1)));
      for (int i = (1); i < (m); ++i) {
        mat[ptr][i - 1] = v[i];
      }
      submod(mat[ptr][m - 2], v[0]);
      ptr++;
    }
  assert(ptr == m - 2);
  gauss(mat);
  int res = dp[k - 1][n - k][0];
  for (int i = (1); i < (m - 1); ++i) {
    addmod(res, mult(mat[i - 1][m - 2], dp[k - 1][n - k][i]));
  }
  cout << res << "\n";
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0), cin.tie(0);
  if (argc > 1) {
    assert(freopen(argv[1], "r", stdin));
  }
  if (argc > 2) {
    assert(freopen(argv[2], "wb", stdout));
  }
  chemthan();
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
