#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int maxn = 5e3 + 100;
long long dp[maxn][maxn], d[maxn];
int l[maxn], r[maxn];
int main() {
  int n, x, m, k;
  cin >> n >> x >> m >> k;
  memset(dp, 0, sizeof(dp));
  memset(l, 0, sizeof(l));
  memset(r, 0, sizeof(r));
  for (int i = 1; i <= n; i++) {
    long long dis = abs(i - m) - 1;
    r[i] = min((long long)n, i + dis);
    l[i] = max(1LL, i - dis);
  }
  if (x <= n) dp[0][x] = 1;
  for (int i = 0; i < k; i++) {
    memset(d, 0, sizeof(d));
    for (int j = 1; j <= n; j++) {
      d[l[j] - 1] = (d[l[j] - 1] - dp[i][j]) % M;
      d[j - 1] = (d[j - 1] + dp[i][j]) % M;
      d[j] = (d[j] - dp[i][j]) % M;
      d[r[j]] = (d[r[j]] + dp[i][j]) % M;
    }
    dp[0][x] = 0;
    for (int j = n; j > 0; j--) {
      dp[i + 1][j] = (dp[i + 1][j + 1] + d[j]) % M;
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = (ans + dp[k][i] + M) % M;
  }
  cout << ans << endl;
}
