#include <bits/stdc++.h>
const int mod = (int)1e9 + 7;
long long f[5001][5001];
long long d[5001][2];
long long getMod(long long n) {
  if (n >= 0) return n % mod;
  while (n < 0) n += mod;
  return n;
}
long long getSum(int l, int r, int idx) {
  if (l > r) return 0;
  return getMod(d[r][idx] - d[l - 1][idx]);
}
int main(void) {
  int n, a, b, k;
  scanf("%i %i %i %i", &n, &a, &b, &k);
  int i, j, c;
  for (i = 1; i <= n; i++) {
    f[i][0] = 1;
    d[i][0] = d[i - 1][0] + 1;
  }
  for (j = 1; j <= k; j++)
    for (i = 1; i <= n; i++) {
      d[i][j & 01] = d[i - 1][j & 01];
      if (i == b) continue;
      int l = (1 > i - abs(i - b) + 1 ? 1 : i - abs(i - b) + 1),
          r = (n < i + abs(i - b) - 1 ? n : i + abs(i - b) - 1);
      f[i][j] = getSum(l, i - 1, (j - 1) & 01) + getSum(i + 1, r, (j - 1) & 01);
      if (f[i][j] >= mod) f[i][j] %= mod;
      d[i][j & 01] += f[i][j];
      if (d[i][j & 01] >= mod) d[i][j & 01] %= mod;
    }
  printf("%lld\n", f[a][k]);
  return 0;
}
