#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
const int mod = 1000000007;
int n, a, b, k;
int dp[N][N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> a >> b >> k;
  for (long long i = 1; i <= n; ++i) {
    dp[0][i] = i;
  }
  for (int trip = 1; trip <= k; trip++) {
    for (int floor = 1; floor <= n; floor++) {
      int d = abs(b - floor);
      dp[trip][floor] = dp[trip - 1][min(n, floor + d - 1)] -
                        dp[trip - 1][max(0, floor - d)] - dp[trip - 1][floor] +
                        dp[trip - 1][floor - 1];
      while (dp[trip][floor] < 0) dp[trip][floor] += mod;
      dp[trip][floor] %= mod;
      dp[trip][floor] = (dp[trip][floor] + dp[trip][floor - 1]) % mod;
    }
  }
  cout << (dp[k][a] - dp[k][a - 1] + mod) % mod;
  return 0;
}
