#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long a, b, k, t, s;
long long ans;
long long sum[1000005], dp[1000005];
int main() {
  scanf("%I64d%I64d%I64d%I64d", &a, &b, &k, &t);
  s = 2 * k * t;
  dp[0] = 1;
  for (long long i = 0; i <= s; i++) sum[i] = 1;
  for (long long i = 1; i <= t; i++) {
    for (long long j = 0; j <= s; j++) {
      if (j <= 2 * k)
        dp[j] = sum[j];
      else
        dp[j] = (sum[j] - sum[j - 2 * k - 1] + MOD) % MOD;
    }
    sum[0] = dp[0];
    for (long long i = 1; i <= s + 100; i++)
      sum[i] = (sum[i - 1] + dp[i] + MOD) % MOD;
  }
  for (long long i = (b + 1 > a) * (b + 1 - a); i <= s; i++)
    ans = (ans % MOD + (1LL * sum[i + a - b - 1] * dp[i]) % MOD) % MOD;
  printf("%I64d", ans);
  return 0;
}
