#include //eolibraries #define lnf 3999999999999999999 #define inf 999999999 #define fi first #define se second #define pb push_back #define all(c) (c).begin(),(c).end() #define sz(c) (int)(c).size() #define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end()); #define rep(i,n) for(int i=0;i=0;i--) #define crep(i,x,n) for(int i=x;i #define _3E8xdS5 ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0) //eodefine using namespace std; typedef long long ll; typedef long double ld; using pii=pair; using vi=vec(int); using vll=vec(ll); const int mxn=2e6; //snuke's modular int template struct modularint{ ll x; modularint(ll x=0):x(x%mod){} modularint& operator+=(const modularint a){ if ((x += a.x) >= mod) x -= mod; return *this; } modularint& operator-=(const modularint a){ if ((x += mod-a.x) >= mod) x -= mod; return *this; } modularint& operator*=(const modularint a){ (x *= a.x) %= mod; return *this; } modularint operator+(const modularint a)const{ modularint res(*this); return res+=a; } modularint operator-(const modularint a)const{ modularint res(*this); return res-=a; } modularint operator*(const modularint a)const{ modularint res(*this); return res*=a; } modularint pow(ll n)const{ modularint res=1,x(*this); while(n){ if(n&1)res*=x; x*=x; n>>=1; } return res; } modularint inv()const{ return pow(mod-2); } }; using mint=modularint<1000000007>; mint fact[mxn+10]; void prefact(){ fact[0]=fact[1]=1; crep(i,2,mxn){ mint x=i; fact[i]=fact[i-1]*x; } } mint cnk(ll k,ll n){ if(k>n) return 0; mint e=fact[k]*fact[n-k]; return fact[n] * e.inv(); } int main(){ _3E8xdS5; prefact(); int a,b,x,y; cin>>a>>b>>x>>y; vi rbts; rep(i,4){ rbts.pb(b/4); } int z=b%4; rep(i,z+1){ rbts[i]++; } mint ans=0; rep(i,a+1){ vi nowrbts(4); nowrbts[0]=i; nowrbts[2]=(i-x); ll j=a-(nowrbts[0]+nowrbts[2]); if(nowrbts[1]<0) continue; if((j-y)%2) continue; ll yl=(j-y)/2,yr=(y+yl); if(min(yl,yr)<0) continue; if(yr-yl!=y) continue; nowrbts[3]=yl; nowrbts[1]=yr; mint now=1; rep(j,4){ if(rbts[j]==0 and nowrbts[j]>0){ // cout<