{-# LANGUAGE MultiWayIf #-}

import Data.Maybe (maybe, fromJust, fromMaybe, isJust, isNothing)
import Data.Maybe (catMaybes, listToMaybe, mapMaybe, maybeToList)

import qualified Data.Array.IArray as I
import qualified Data.Array.MArray as M

import Data.Array.IO (IOArray)
import Data.Array.ST (STArray)

import Data.Bifunctor (bimap, first, second)
import Data.Foldable (sum, product, and, or)
import Data.Function
import Data.Monoid ((<>), Dual (..), Sum (..))

import qualified Data.List     as L

import Control.Applicative
import Control.Monad
import Control.Monad.ST (runST)

main :: IO ()
main = do
  [h, w, a, b] <- getSeq
  print $ solve h w a b

getSeq  = map read . words <$> getLine   :: Read a => IO [a]

mymod = 10 ^ 9 + 7
type DPValue = Dual (Maybe (Sum Int))
dpJust    = Dual . Just . Sum
dpNothing = Dual Nothing

solve :: Int -> Int -> Int -> Int -> Int
solve h w a b = runST $ do
  dp <- M.newArray ((1, 1), (h, w)) (dpJust 0) :: ST s (STArray s (Int, Int) DPValue)
  forM_ [1..h] $ \y ->
    forM_ [1..w] $ \x ->
      if | x == 1 || y == 1 =
            modifyArray dp (y, x) (<> dpJust 1)
         | x >= h - a || y >= w - b =
            M.writeArray dp (y, x) dpNothing
      	 | otherwise = do
            above <- M.readArray dp (y-1, x)
            left  <- M.readArray dp (y, x-1)
            M.writeArray dp (y, x) ((liftA . liftA $ liftA mod) (above <> left) mymod)
  getDual . fromJust . getSum <$> M.readArray dp (h, w)
