#include <bits/stdc++.h>
using namespace std;
int N, A, B, K;
int d[2][5040];
void ruiseki(int id) {
  for (int i = 1; i < 5040; i++)
    d[id][i] = (d[id][i - 1] + d[id][i]) % 1000000007;
}
int main() {
  scanf("%d%d%d%d", &N, &A, &B, &K);
  d[0][A] = 1;
  int cur = 1, nxt = 0;
  for (int(_) = 0; (_) < (K); (_)++) {
    swap(cur, nxt);
    memset((d[nxt]), (0), sizeof(d[nxt]));
    for (int i = 1; i <= N; i++)
      if (i != B) {
        int dd = abs(i - B) - 1;
        int val = d[cur][i];
        d[nxt][max(1, i - dd)] = (d[nxt][max(1, i - dd)] + val) % 1000000007;
        d[nxt][i] = (d[nxt][i] + 1000000007 - val) % 1000000007;
        d[nxt][i + 1] = (d[nxt][i + 1] + val) % 1000000007;
        d[nxt][min(5020, i + dd + 1)] =
            (d[nxt][min(5020, i + dd + 1)] + 1000000007 - val) % 1000000007;
      }
    ruiseki(nxt);
  }
  int sum = 0;
  for (int i = 1; i <= N; i++) sum = (sum + d[nxt][i]) % 1000000007;
  printf("%d\n", sum);
}
