#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
long long dp[2][402000];
const long long off = 200000;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long a, b, k, t;
  cin >> a >> b >> k >> t;
  long long req = b - a + 1;
  dp[0][off] = 1;
  for (long long i = 0; i < 2 * t; i++) {
    long long cursum = 0;
    long long l = off - (k * i);
    long long r = l;
    for (long long j = (off - (k * i) - k); j <= (off + (k * i) + k); j++) {
      cursum = (cursum + dp[i % 2][r++]) % M;
      dp[(i + 1) % 2][j] = cursum;
      if (r - l > (2 * k)) cursum = (cursum - dp[i % 2][l++] + M) % M;
    }
  }
  long long ans = 0;
  for (long long i = req + off; i <= 2 * k * t + off; i++)
    ans = (ans + dp[0][i]) % M;
  cout << ans;
}
