#include <bits/stdc++.h>
using namespace std;
int dp[5011][5011];
int bit[5011][5011];
int n, a, b, s;
inline void upd(int k, int p, int x) {
  for (int i = p; i <= n; i += i & -i) {
    bit[k][i] += x;
    if (bit[k][i] >= 1000000007) bit[k][i] -= 1000000007;
  }
}
inline int query(int k, int p) {
  int ret = 0;
  for (int i = p; i > 0; i -= i & -i) {
    ret += bit[k][i];
    if (ret >= 1000000007) ret -= 1000000007;
  }
  return ret;
}
int main() {
  cin >> n >> a >> b >> s;
  for (int p = 1; p <= n; p++) {
    dp[0][p] = 1;
    upd(0, p, 1);
  }
  for (int k = 1; k <= s; k++)
    for (int p = 1; p <= n; p++) {
      int gap = abs(p - b) - 1;
      dp[k][p] += query(k - 1, min(p + gap, n));
      if (dp[k][p] >= 1000000007) dp[k][p] -= 1000000007;
      dp[k][p] += 1000000007 - query(k - 1, max(p - gap - 1, 0));
      if (dp[k][p] >= 1000000007) dp[k][p] -= 1000000007;
      dp[k][p] += 1000000007 - dp[k - 1][p];
      if (dp[k][p] >= 1000000007) dp[k][p] -= 1000000007;
      upd(k, p, dp[k][p]);
    }
  cout << dp[s][a] << endl;
}
