#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
double EPS = 1e-7;
int INF = 1000000000;
long long INFLL = 1000000000000000000LL;
int mx[8] = {-1, 1, 0, 0, -1, -1, 1, 1};
int my[8] = {0, 0, -1, 1, -1, 1, -1, 1};
int dp[5005];
int pre[5005];
int mod = 1000000007;
int main() {
  int n, x, y, k;
  scanf("%d%d%d%d", &n, &x, &y, &k);
  for (int(a) = (1); (a) <= (n); (a)++) {
    dp[a] = (a != y);
    pre[a] = pre[a - 1] + dp[a];
  }
  for (int(a) = (1); (a) <= (k); (a)++) {
    for (int(b) = (1); (b) <= (n); (b)++) {
      int dif = abs(b - y) - 1;
      int fl = max(1, b - dif);
      int fr = min(n, b + dif);
      dp[b] = mod - dp[b];
      dp[b] += (mod - pre[fl - 1]);
      if (dp[b] >= mod) dp[b] -= mod;
      dp[b] += pre[fr];
      if (dp[b] >= mod) dp[b] -= mod;
    }
    for (int(b) = (1); (b) <= (n); (b)++) {
      pre[b] = pre[b - 1];
      pre[b] += dp[b];
      if (pre[b] >= mod) pre[b] -= mod;
    }
  }
  printf("%d\n", dp[x]);
}
