#include <bits/stdc++.h>
using namespace std;
const int maxn = 6233;
const int mod = 1000000007;
int f[maxn][maxn];
int main() {
  int n, a, b, k;
  scanf("%d%d%d%d", &n, &a, &b, &k);
  f[0][a] = 1;
  for (int i = 0; i < k; ++i) {
    for (int j = 1; j <= n; ++j)
      if (j != b) {
        int l = abs(j - b);
        int L = max(1, j - l + 1), R = min(n, j + l - 1);
        f[i + 1][L] = (f[i + 1][L] + f[i][j]) % mod;
        f[i + 1][j] = (f[i + 1][j] - f[i][j]) % mod;
        f[i + 1][j + 1] = (f[i + 1][j + 1] + f[i][j]) % mod;
        f[i + 1][R + 1] = (f[i + 1][R + 1] - f[i][j]) % mod;
      }
    for (int j = 2; j <= n; ++j)
      f[i + 1][j] = (f[i + 1][j] + f[i + 1][j - 1]) % mod;
  }
  int sum = 0;
  for (int i = 1; i <= n; ++i) sum = (sum + f[k][i]) % mod;
  sum %= mod;
  sum += mod;
  sum %= mod;
  printf("%d\n", sum);
  return 0;
}
