module Main where

import           Control.Monad
import           Debug.Trace
import qualified Data.Vector                   as V
import qualified Data.Vector.Mutable           as VM
import qualified Data.Vector.Unboxed           as VU
import qualified Data.Vector.Unboxed.Mutable   as VUM
import           Data.List
import qualified Data.ByteString               as BS
import qualified Data.ByteString.Char8         as BSC8
import           Data.Char
import           Data.Maybe
import           Data.Ord
import           Data.Vector.Algorithms.Search
import qualified Data.Array                    as A
import qualified Data.Array.Unboxed            as AU
import qualified Data.Array.IO                 as AIO



getvuil :: IO (VU.Vector Int)
getvuil = VU.unfoldr (BSC8.readInt . BSC8.dropWhile isSpace) <$> BSC8.getLine
readi :: BSC8.ByteString -> Int
readi = fst . fromJust . BSC8.readInt
readil :: BSC8.ByteString -> [Int]
readil = map readi . BSC8.words
geti :: IO Int
geti = readi <$> BSC8.getLine
getil :: IO [Int]
getil = readil <$> BSC8.getLine

getNis :: Int -> IO [(Int, BSC8.ByteString)]
getNis 0 = return []
getisl n = do
    [aFst, aSnd] <- BSC8.words <$> BSC8.getLine
    next         <- (getisl (n - 1))
    return ((readi aFst, aSnd) : next)

il2ss :: [Int] -> String
il2ss = unwords . map show

il2sn :: [Int] -> String
il2sn = unlines . map show

combi :: Int -> Int -> Int
combi x y = mod (div (fact x) ((fact (x - y)) * (fact y))) 1000000007

fact :: Int -> Int
fact x = product [1 .. x]

main :: IO ()
main = do
    [aH, aW, aA, aB] <- getil
    array            <-
        AIO.newArray ((1, 1), (aH, aW)) 0 :: IO (AIO.IOUArray (Int, Int) Int)
    ret <- answer array aH aW aA aB
    print ret

answer :: AIO.IOUArray (Int, Int) Int -> Int -> Int -> Int -> Int -> IO Int
answer array h w a b = do
    let
        posiNum = scanl
            (\acc@(accPosi, accNum) y ->
                ( y
                , mod (div (accNum * ((h - y) + (w - b) - 1)) (h - y))
                      1000000008
                )
            )
            (fixedY, combi ((a) + (w - b) - 1) (a))
            (reverse [1 .. fixedY - 1])
    trace (show posiNum) $ mapM_
        (\(posi, num) -> AIO.writeArray array (posi, fixedX) num)
        posiNum
    mapM_
        (\y -> mapM_
            (\x -> do
                down  <- AIO.readArray array (y + 1, x)
                right <- AIO.readArray array (y, x + 1)

                trace ((show down) ++ (show right))
                      AIO.writeArray
                      array
                      (y, x)
                      (down + right)
            )
            (reverse [1 .. fixedX - 1])
        )
        (reverse [1 .. fixedY])
    AIO.readArray array (1, 1)
  where
    fixedY = h - a
    fixedX = b + 1


