#include <bits/stdc++.h>
using namespace std;
long long tree[200005];
int sz;
long long temp[200005];
long long sum[200005];
int main() {
  int n, a, k, b;
  cin >> n >> a >> b >> k;
  sz = n;
  int range_s, range_e;
  if (a < b) {
    range_s = 1;
    range_e = b - 1;
  } else {
    range_s = b + 1;
    range_e = n;
  }
  for (int i = range_s; i <= range_e; i++) {
    if (i == range_s)
      sum[i] = 1;
    else
      sum[i] = sum[i - 1] + 1;
  }
  for (int i = 1; i <= k; i++) {
    for (int j = range_s; j <= range_e; j++) {
      long long tt;
      if (a < b) {
        tt = (sum[j - 1] - sum[max(0, 2 * j - b)]) % 1000000007 +
             (sum[b - 1] - sum[j]) % 1000000007;
        tt %= 1000000007;
      } else {
        tt = (sum[j - 1] - sum[b]) % 1000000007 +
             (sum[min(j + j - b - 1, n)] - sum[j]) % 1000000007;
        tt %= 1000000007;
      }
      temp[j] = tt;
      if (temp[j] < 0) {
        temp[j] += 1000000007;
      }
    }
    for (int j = range_s; j <= range_e; j++) {
      sum[j] = temp[j];
      if (j > range_s) {
        sum[j] = (sum[j - 1] + sum[j]) % 1000000007;
      }
    }
  }
  cout << temp[a];
  return 0;
}
