let solve h w a b =
  Printf.printf "Start"; print_newline ();
  let dp = Array.make_matrix w h 0 in
  Printf.printf "Array Initialized"; print_newline ();
  for x = 0 to (w-1) do
    dp.(x).(0) <- 1
  done;
  for y = 0 to (h-1) do
    dp.(0).(y) <- 1
  done;
  for x = 1 to (w-1) do
    for y = 1 to (h-1) do
      dp.(x).(y) <-
        (if x >= b || y < (h-a) then
          dp.(x-1).(y) + dp.(x).(y-1)
        else
          0) mod 1000000007
    done;
  done;
  dp.(w-1).(h-1)

let () =
  (*let h, w, a, b = Scanf.scanf "%d %d %d %d\n" (fun w x y z -> w, x, y, z) in*)
  let h, w, a, b = 50000, 50000, 999, 999 in
  let ans = solve h w a b in
  Printf.printf "%d\n" ans
;;
