#include <bits/stdc++.h>
using namespace std;
const int N = (int)3e5 + 10;
const int base = N / 2;
const long long mod = (long long)1e9 + 7;
int a, b, k, t;
long long p[N][2];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> a >> b >> k >> t;
  int c = 0;
  for (int i = base - k; i <= base + k; ++i) p[i][c] = 1;
  for (int i = base - k; i < N; ++i) p[i][c] += p[i - 1][c];
  for (int i = 1; i <= t - 1; ++i) {
    for (int j = base - k * (i + 1); j <= base + k * (i + 1); ++j) {
      p[j][c ^ 1] = (p[j + k][c] - p[j - k - 1][c] + mod) % mod;
    }
    for (int j = base - k * (i + 1); j < N; ++j)
      (p[j][c ^ 1] += p[j - 1][c ^ 1]) %= mod;
    for (int j = base - k * i; j < N; j++) p[j][c] = 0;
    c ^= 1;
  }
  long long ans = 0LL;
  for (int i = base - k * t; i <= base + k * t; ++i) {
    int new_a = a + (i - base);
    int j = new_a - b - 1 + base;
    ans = (ans + ((p[i][c] - p[i - 1][c]) * p[j][c]) % mod) % mod;
  }
  cout << ans << endl;
  return 0;
}
