Problem:
Score : 400 points

Problem Statement

We have a large square grid with H rows and W columns.
Iroha is now standing in the top-left cell.
She will repeat going right or down to the adjacent cell, until she reaches the bottom-right cell.

However, she cannot enter the cells in the intersection of the bottom A rows and the leftmost B columns. (That is, there are A×B forbidden cells.) There is no restriction on entering the other cells.

Find the number of ways she can travel to the bottom-right cell.

Since this number can be extremely large, print the number modulo 10^9+7.

Constraints

1 ≦ H, W ≦ 100,000

1 ≦ A < H

1 ≦ B < W

Input

The input is given from Standard Input in the following format:

H W A B

Output

Print the number of ways she can travel to the bottom-right cell, modulo 10^9+7.

Sample Input 1

2 3 1 1

Sample Output 1

2

We have a 2×3 grid, but entering the bottom-left cell is forbidden. The number of ways to travel is two: "Right, Right, Down" and "Right, Down, Right".

Sample Input 2

10 7 3 4

Sample Output 2

3570

There are 12 forbidden cells.

Sample Input 3

100000 100000 99999 99999

Sample Output 3

1

Sample Input 4

100000 100000 44444 55555

Sample Output 4

738162020

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <vector>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <map>
#include <array>
#include <iterator>
#include <cstdlib>
namespace XX
{   
    template<template<typename> class Compare, typename T>
    inline T& UP(T& x, const T& y){if(Compare<T>()(y, x)) x = y; return x;}
    template<typename Compare, typename T>
    inline T& UP(T& x, const T& y, Compare comp){if(comp(y, x)) x = y; return x;}

    template<typename T> inline T& GT(T& x, const T& y){return UP<std::greater>(x, y);}
    template<typename T> inline T& LS(T& x, const T& y){return UP<std::less>(x, y);}

    template<typename T>
    struct Mapper
    {
        int operator[](const T& v) { int& ret = table[v]; if(!ret) rtable[ret = table.size()] = v; return ret - 1; }
        template<typename... Args> int operator()(Args... args) { return (*this)[T(args...)]; }
        T rev(int idx){return rtable[idx + 1];}
        std::map<T, int> table;
        std::map<int, T> rtable;
    };

    template<typename T, int S>
    struct ReferenceArray
    {
        struct It {typename std::array<T*, S>::iterator it; T& operator*(){return **it;} void operator++(){it++;} bool operator!=(const It& other){return it != other.it;} };
        int size()const{return _ptr.size();}
        It begin()const{return {_ptr.begin()};}
        It end()const{return {_ptr.end()};}
        T& operator[](int idx)const{return *_ptr[idx];}
        mutable std::array<T*, S> _ptr;
    };
    template<typename T, typename... Args> 
    ReferenceArray<T, sizeof...(Args) + 1> MAKEV(T& arg1, Args&... args) {return {&arg1, &args...};}

    struct Range
    {   
        struct It {   int num, step; int operator*(){return num;} void operator++(){num += step;} bool operator!=(const It& other){return num != other.num;} };
        Range(int ee):b(0),e(ee){}
        Range(int bb, int ee):b(bb), e(ee){}
        It begin(){return {b, (b < e? 1: -1)};}
        It end(){return {e, 0};}
        int b, e;
    };

}



template<typename T> struct ScanfSpecifier{};
#define DEF(T,V) template<> struct ScanfSpecifier<T>{static constexpr const char* value = V;};
DEF(int,"%d")DEF(double,"%lf")DEF(float,"%f")DEF(char,"%c")DEF(const char*,"%s")DEF(unsigned long,"%lu")DEF(char*,"%s")DEF(unsigned int, "%u")
#ifdef _MSC_VER
DEF(long long int,"%I64d")
#else
DEF(long long int,"%lld")
#endif
#undef DEF
template<typename T> int RD(T& arg){return std::scanf(ScanfSpecifier<T>::value, &arg);}
template<int S> int RD(char (&arg)[S]){return std::scanf("%s", arg);}
template<> int RD<char*>(char*& arg){return std::scanf("%s", arg);}
template<> int RD<char>(char& arg){return std::scanf(" %c", &arg);}
template<typename T, typename... Args> int RD(T& arg1, Args&... args) {return RD(arg1) + RD(args...);}
template<typename T> T RD(){T ret; RD(ret); return ret;}
template<typename It> void RDV(It begin, It end) { while(begin != end) RD(*begin++); }
template<typename C> void RDV(C& c) {RDV(std::begin(c), std::end(c));}
template<typename... Args> void WT(Args... args) { int alc = 0; int dummy[] = {((alc++? std::printf(" "): 0), std::printf(ScanfSpecifier<Args>::value, args), 0)...}; }
template<typename... Args> void WTL(Args... args) { WT(args...); std::printf("\n"); }
template<typename It> void WTV(It begin, It end) { int alc = 0; while(begin != end) (alc++? std::printf(" "): 0), WT(*begin++); }
template<typename C> void WTV(const C& c) {WTV(std::begin(c), std::end(c));}
template<typename It> void WTVL(It begin, It end) { WTV(begin, end); std::printf("\n"); }
template<typename C> void WTVL(const C& c) {WTVL(std::begin(c), std::end(c));}



template<unsigned int P>
struct ZpZ
{
    using U64 = unsigned long long int;
    U64 value;
    ZpZ(long long int n) {if(std::abs(n) >= P)n %= P; if(n < 0)n += P; value = n;}
    ZpZ():value(0){}
    ZpZ& operator+=(ZpZ p){if((value += p.value) >= P)value -= P; return *this;}
    ZpZ& operator-=(ZpZ p){if(value >= p.value)value -= p.value; else value += P - p.value; return *this;}
    ZpZ& operator*=(ZpZ p){value = value * p.value % P; return *this;}
    ZpZ& operator/=(ZpZ p){value = value * p.inverse().value % P; return *this;}
    bool operator==(ZpZ p){return value == p.value;}
    bool operator!=(ZpZ p){return value != p.value;}

#define DEF(op) ZpZ operator op(ZpZ r)const{return ZpZ(value) op##= r;}
DEF(+)DEF(-)DEF(*)DEF(/)
#undef DEF

    explicit operator long long int(){return value;}
    explicit operator int(){return value;}
    ZpZ operator-(){return P - value;}
    ZpZ inverse()
    {
        int a = value, b = P, u = 1, v = 0;
        while(b) 
        {
            int t = a / b;
            std::swap(a -= t * b, b); 
            std::swap(u -= t * v, v);
        }
        if(u < 0) u += P;
        return u;
    }
    ZpZ pow(U64 e)
    {
        U64 ret = 1, base = value;
        while(e)
        {
            if((e & 1) && ((ret *= base) >> 32))
                ret %= P;
            if((base *= base) >> 32)
                base %= P;
            e >>= 1;
        }
        return ret;
    }

};







//alias
const int MOD = 1e9 + 7;
using ZZ = ZpZ<MOD>;
ZZ min(ZZ a, ZZ b){return std::min(a.value, b.value);}
ZZ max(ZZ a, ZZ b){return std::max(a.value, b.value);}
//RD[L],RDV[L],WT[L],WTV[L] for i/o
template<typename T> T& UMAX(T& x, T y){return XX::UP<std::greater>(x, y);}
template<typename T> T& UMIN(T& x, T y){return XX::UP<std::less>(x, y);}
using XX::UP; //(x,y) comp
using RG = XX::Range;
using XX::MAKEV;
using XX::Mapper;
//template
#include <vector>
#include <string>
#include <set>
#include <map>
#include <cstdlib>
#include <algorithm>
#include <functional>
using namespace std;

const int SIZE = 200009;
ZZ fs[SIZE], table[SIZE];




int main()
{
    fs[0] = 1;
    for(int i = 1; i < SIZE; i++)
        fs[i] = fs[i - 1] * i;
    
    int H, W, A, B;
    RD(H, W, A, B);

    ZZ ans = 0;
    ZZ pre = 0;
    for(int i = 0; i < H - A; i++)
    {
        pre += (table[i] = fs[i + B] / fs[i] / fs[B] - pre);
        ans += table[i] * fs[H - i - 1 + W - 1 - B] / fs[H - i - 1] / fs[W - 1 - B];
    }

    WTL((int)ans);


}