#include #include #include #include using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(n); i++) using m32 = atcoder::modint1000000007; int main(){ int A,B,X,Y; cin >> A >> B >> X >> Y; vector F,I,iF; int Z = A+B+abs(X)+abs(Y); F.assign(Z+1,1); for(int i=1; i<=Z; i++) F[i] = F[i-1] * i; I.assign(Z+1,1); for(int i=2; i<=Z; i++) I[i] = -1000000007/i * I[1000000007%i]; iF.assign(Z+1,1); for(int i=1; i<=Z; i++) iF[i] = iF[i-1] * I[i]; auto Comb = [&](int n,int r)->m32{ if(n 0 && cR == 0){ cout << 0 << endl; return 0; } if(Y > 0 && cU == 0){ cout << 0 << endl; return 0; } m32 ans = 0; for(int i=0; i*2<=leftA; i++){ int j = leftA/2 - i; if(i != 0 && cL == 0) continue; if(j != 0 && cD == 0) continue; m32 tmp = 1; if(i != 0) tmp *= Comb(i+cL-1,i); if(j != 0) tmp *= Comb(j+cD-1,j); if(j+X != 0) tmp *= Comb(i+X+cR-1,i+X); if(j+Y != 0) tmp *= Comb(j+Y+cU-1,j+Y); ans += tmp; } cout << ans.val() << endl; return 0; } struct ios_do_not_sync { ios_do_not_sync() { ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;