#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200000;
const int MOD = 1000000007;
int dp[2][MAXN + 10];
int main() {
  int a, b, k, t;
  scanf("%d%d%d%d", &a, &b, &k, &t);
  dp[1][100001] = 1;
  int Max = MAXN + 1;
  for (int i = 1; i <= t; i++) {
    int sum = 0;
    for (int j = 0; j <= k; j++)
      if (1 + j <= Max) (sum += dp[1][1 + j]) %= MOD;
    for (int j = 1; j <= Max; j++) {
      dp[0][j] = sum;
      if (j - k >= 1) (sum -= dp[1][j - k]) %= MOD;
      if (j + k + 1 <= Max) (sum += dp[1][j + k + 1]) %= MOD;
    }
    swap(dp[0], dp[1]);
  }
  int offset = b - a + 1, ans = 0, tsum = 0;
  for (int i = max(1, 1 + offset); i <= Max; i++) (tsum += dp[1][i]) %= MOD;
  for (int i = 1; i <= Max; i++) {
    (ans += (1LL * dp[1][i] * tsum) % MOD) %= MOD;
    if (i + offset > 0 && i + offset <= Max) (tsum -= dp[1][i + offset]) %= MOD;
  }
  printf("%d\n", (ans % MOD + MOD) % MOD);
  return 0;
}
