You are given integers n, a, b, and k. There are n positions on a line, numbered 1 to n, you start at position a, and a fixed anchor sits at position b.
You must make exactly k jumps. A jump from the current position x may land on any position y with:
y != x, and|x - y| < |x - b|, meaning the jump must be strictly shorter than your current distance to the anchor.Two sequences are different if they differ at any step.
Return the number of valid sequences of exactly k jumps. Mod the result by 10^9 + 7.
Input: n = 5, a = 2, b = 5, k = 1
Output: 3
Explanation: From position 2 the distance to the anchor is 3, so a jump may
cover distance 1 or 2: positions 1, 3, and 4 are reachable.
Input: n = 5, a = 2, b = 5, k = 2
Output: 5
Explanation: The 3 first jumps above continue as follows: from 1 (distance 4)
positions 2, 3, 4 are reachable; from 3 (distance 2) positions 2 and 4; from 4
(distance 1) no jump is short enough. Total 3 + 2 + 0 = 5.