//#define _GLIBCXX_DEBUG #include #include #include #include using namespace std; using namespace atcoder; using mint = modint1000000007; using ll = long long; using pii = pair; using pll = pair; using vi = vector; using vvi = vector; using vl = vector; using vvl = vector; using vb = vector; using vvb = vector; using vm = vector; using vvm = vector; using vpi = vector; using vvpi = vector; using vpl = vector; using vvpl = vector; const int inf = 1 << 30; const ll INF = 1LL << 60; #define rep(i,m,n) for (int i = m; i < (int)(n); i++) #define rrep(i,m,n) for (int i = m; i > (int)(n); i--) const int MAX = 2000001; //nの最大 vm fac(MAX),finv(MAX); void set_fac(){ fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; rep(i,2,MAX){ fac[i] = fac[i-1]*i; finv[i] = finv[i-1] * mint(i).inv(); } } mint cmb(int n,int k){ if (k < 0 || n < 0 || n < k) return 0; return fac[n]*finv[n-k]*finv[k]; } int main(){ set_fac(); int a,b,x,y; cin >> a >> b >> x >> y; vi s(4,(b+1)/4-1); rep(i,0,(b+1)%4){ s[i]++; } rep(i,0,4){ if (s[i] < 0){ s[i] = 0; } } //cout << s[0] << s[1] << s[2] << s[3] << endl; mint ans = 0; rep(i,0,a+1){ int j = a - i; if ((i+x)%2 == 1 || (j+y)%2 == 1) continue; //cout << i << " " << j << endl; int x0 = (i+x)/2,x2 = (i-x)/2,y1 = (j+y)/2,y3 = (j-y)/2; if (x0 < 0 || x2 < 0 || y1 < 0 || y3 < 0) continue; //cout << x0 << " " << x2 << " " << y1 << " " << y3 << endl; ans += cmb(x0+s[0],s[0])*cmb(x2+s[2],s[2])*cmb(y1+s[1],s[1])*cmb(y3+s[3],s[3]); } cout << ans.val() << endl; }