#include <bits/stdc++.h>
using namespace std;
const int maxn = 500000;
const int mid = 250000;
const int mod = 1e9 + 7;
int a, b, k, t;
int dp[maxn][2], pre[maxn][2];
int main() {
  cin >> a >> b >> k >> t;
  dp[a - b + mid][0] = 1;
  for (int i = a - b + mid; i < maxn; i++) pre[i][0] = 1;
  for (int i = 1; i <= t; i++) {
    dp[1][i % 2] = 0;
    for (int j = 1; j <= 2 * k + 1; j++)
      dp[1][i % 2] =
          (dp[1][i % 2] + (2 * k + 2 - j) * dp[j][(i + 1) % 2]) % mod;
    pre[1][i % 2] = dp[1][i % 2];
    for (int j = 2; j < maxn; j++) {
      if (j - 2 * k - 2 >= 0)
        dp[j][i % 2] = ((dp[j - 1][i % 2] - (pre[j - 1][(i + 1) % 2] -
                                             pre[j - 2 * k - 2][(i + 1) % 2]) %
                                                mod) %
                            mod +
                        mod) %
                       mod;
      if (j + 2 * k < maxn)
        dp[j][i % 2] =
            (dp[j][i % 2] +
             ((pre[j + 2 * k][(i + 1) % 2] - pre[j - 1][(i + 1) % 2]) % mod +
              mod) %
                 mod) %
            mod;
      pre[j][i % 2] = (pre[j - 1][i % 2] + dp[j][i % 2]) % mod;
    }
  }
  int ans = 0;
  for (int i = mid + 1; i < maxn; i++) ans = (ans + dp[i][t % 2]) % mod;
  cout << ans;
  return 0;
}
