#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000000000000001;
int n, a, b, k;
int dp[5010][5010];
int main() {
  scanf("%d%d%d", &n, &a, &b);
  scanf("%d", &k);
  int i, j;
  for (int left = 0; left <= k; left += 1) {
    for (int pos = 0; pos <= n; pos++) {
      if (pos == 0) {
        dp[pos][left] = 0;
      } else if (left == 0) {
        dp[pos][left] = pos;
      } else {
        int l = max(1, pos - abs(pos - b) + 1);
        int r = min(n, pos + abs(pos - b) - 1);
        long long ret = 0;
        ret += dp[pos - 1][left];
        ret = (ret + dp[r][left - 1]) % 1000000007;
        ret = (ret - dp[l - 1][left - 1]) % 1000000007;
        ret = (ret - (dp[pos][left - 1] - dp[pos - 1][left - 1])) % 1000000007;
        dp[pos][left] = ret;
      }
    }
  }
  long long ans =
      ((dp[a][k] - dp[a - 1][k]) % 1000000007 + 1000000007) % 1000000007;
  printf("%lld\n", ans);
  return 0;
}
