#include <bits/stdc++.h>
using namespace std;
int n, a, b, s, dp[5005][5005], sum[5005][5005];
void mo(int &x) {
  while (x > 1000000007) x -= 1000000007;
}
signed main() {
  int i, p;
  cin >> n >> a >> b >> s;
  if (a > b) {
    a = n - a + 1;
    b = n - b + 1;
  }
  dp[a][0] = 1;
  for (p = 1; p <= s; p++) {
    for (i = 1; i < b; i++)
      mo(sum[i][p - 1] = sum[i - 1][p - 1] + dp[i][p - 1]);
    for (i = 1; i < b; i++) {
      mo(dp[i][p] += sum[i - 1][p - 1]);
      mo(dp[i][p] +=
         (sum[(i + b - 1) / 2][p - 1] - sum[i][p - 1] + 1000000007) %
         1000000007);
    }
  }
  for (i = 1; i <= b; i++) mo(sum[i][s] = sum[i - 1][s] + dp[i][s]);
  cout << sum[b][s] << endl;
  return 0;
}
