#include <bits/stdc++.h>
using namespace std;
using ii = pair<long long, long long>;
using vi = vector<long long>;
using vb = vector<bool>;
using vii = vector<ii>;
const long long N = 1e5 + 5, MOD = 1e9 + 7, INF = 1e9 + 5;
long long add(long long x, long long y) {
  return ((x % MOD) + (y % MOD)) % MOD;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  long long n, a, b, k;
  cin >> n >> a >> b >> k;
  long long dp[k + 2][n + 2];
  for (long long i = 0; i <= k + 1; i++)
    for (long long j = 0; j <= n + 1; j++) dp[i][j] = 0;
  dp[0][a] = 1;
  for (long long i = 0; i < k; i++) {
    for (long long j = 1; j <= n; j++) {
      if (dp[i][j]) {
        long long dist = abs(j - b);
        long long l = max(1LL, j - dist + 1);
        long long r = min(j + dist - 1, n);
        dp[i + 1][l] += dp[i][j];
        dp[i + 1][j] -= dp[i][j];
        dp[i + 1][j + 1] += dp[i][j];
        dp[i + 1][r + 1] -= dp[i][j];
      }
    }
    for (long long j = 1; j <= n; j++) dp[i + 1][j] += dp[i + 1][j - 1];
    for (long long j = 1; j <= n; j++) dp[i + 1][j] %= MOD;
  }
  long long ans = 0;
  for (long long j = 1; j <= n; j++) ans = add(ans, dp[k][j]);
  cout << ans;
}
