Problem: Watching baseball

The other day, your competitive programming companion, Mr. O, went out to watch a baseball game. The games I watched were a total of four games, Team X and Team Y, but it was a one-sided development, and Team X won all the games. Moreover, the total score of X in the four games was 33 points, while the total score of Y was only 4 points.

Mr. O, who had lost interest in the content of the game because of the one-sided content, was pondering the question material of competitive programming while watching the game. Partly because of that, Mr. O came up with the following problems.

It is assumed that baseball teams X and Y play against each other, and the number of games X wins, the number of games Y wins, and the number of draw games are A, B, and C, respectively. It is also assumed that the total scores of X and Y in all A + B + C games are SX points and SY points, respectively. All scores are integers greater than or equal to 0. When X and Y play a total of A + B + C matches, how many different scores can be arranged for each match that meets these conditions as a result of all matches?

Here, the condition for winning in a certain game is that the score in that game is higher than the score of the opponent team, and if they are equal, it is a draw.

In addition, when calculating the sequence of scores for each match, when comparing the results of all the matches played against each other, even if the combination of scores of X and Y is the same, it is necessary to distinguish if the order is different. For example, suppose that X and Y play two games, and each wins one, there is no draw, and the total score of X and Y is one point each. In this case, the scores of X and Y in each match are expressed by the notation (X score)-(Y score), and when the results of a total of two matches are arranged, the following two conditions are satisfied.

* 1 --0, 0 --1
* 0 --1, 1 --0



These are distinguished because the order of the games is counted separately.

I want you to create a program that asks for this answer. However, since the number to be obtained can be very large, please answer the remainder obtained by dividing the number to be obtained by 1,000,000,007.

Input

The input consists of multiple datasets. Each dataset consists of one line and is expressed in the following format.

> A B C SX SY

Here, A is the number of team X wins, B is the number of team Y wins, C is the number of draw games, SX is the total score of team X, and SY is the total score of team Y. A, B, C, SX, and SY are all integers between 0 and 1,000,000, and satisfy 0 <A + B + C.

The end of the input is indicated by a line of 5 zeros.

Output

For each dataset, output one line consisting of only the remainder of the number of cases where the given conditions are met divided by 1,000,000,007.

Sample Input


1 1 0 1 1
0 0 2 3 2
4 0 0 33 4
5 4 2 20 25
4726 87361 2742 23497 162843
328324 420923 12782 834286 538297
0 0 0 0 0

Output for Sample Input


2
0
114660
512095631
673703234
166259450





Example

Input

1 1 0 1 1
0 0 2 3 2
4 0 0 33 4
5 4 2 20 25
4726 87361 2742 23497 162843
328324 420923 12782 834286 538297
0 0 0 0 0


Output

2
0
114660
512095631
673703234
166259450

Solution (in CPP):

Solution:
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 3000100

ll fac[SIZE];
ll fac_in_memo[SIZE];

void factorial_init(int n){
  fac[0] = 1;
  for(int i=1;i<=n;i++) fac[i] = (i * fac[i-1])%mod;
}

ll factorial(int n,int M){
  ll ret=1;
  if(n<=1) return 1;
  return fac[n];
  
  for(int i=1;i<=n;i++){
    ret = (ret*i)%M;
  }
  
  return ret;
}

ll power(int k,int n,int M){
  if(n==0) return 1;
  if(n==1) return (ll)k;
  
  ll ret = power(k,n/2,M);
  
  ret=(ret*ret)%M;
  
  if(n%2==1)
    ret=(ret*k)%M;
  
  return ret;
}

ll fac_in(int k, int n, int M){
  if(fac_in_memo[k]) return fac_in_memo[k];
  return fac_in_memo[k] = power(k,n,M);
}

//nCm nPm nHm (mod M)

/*Combination*/
int C(int n,int m,int M){
  if(n<m) return 0;
  if(m==0 || n==m) return 1;
  
  ll chi = factorial(n,M);
  ll mot = (factorial(m,M) * factorial(n-m,M))%M;
  
  mot = power((int)mot,M-2,M);
  
  ll ret = (chi*mot)%M;
  
  return (int)ret;
}
/*Permutation*/
int P(int n,int m,int M){
  if(n<m) return 0;
  if(m==0) return 1;
  
  ll chi = factorial(n,M);
  ll mot = factorial(n-m,M);
  
  
  mot = power((int)mot, M-2,M);
  
  ll ret = (chi*mot)%M;
  
  return (int)ret;
}
/*Combination with Repetitions*/
int H(int n,int m,int M){
  if(n==0 && m==0) return 1;
  return C(n+m-1,m,M);
}



bool solve(){
  int a,b,c,sx,sy;

  scanf("%d%d%d%d%d",&a,&b,&c,&sx,&sy);

  if(a +b + c == 0) return false;
  
  if(sx < sy){
    swap(sx,sy);
    swap(a,b);
  }

  ll ans_sum = 0;
  
  for(int i=sx-sy;i<=sx;i++){
    int p = i;
    int q = i - (sx-sy);

    if(p < a || q < b || (a==0 && p>0) || (b==0 && q > 0)) continue;

    ll ans = 1;

    ans = (ans * C(p-1,a-1,mod))%mod;
    ans = (ans * C(q-1,b-1,mod))%mod;
    ans = (ans * C(sx-i+(c+b+a-1),c+b+a-1,mod))%mod;
    
    ans_sum = (ans_sum + ans)%mod;
  }
  
  ans_sum = (ans_sum * factorial(a+b+c,mod))%mod;
  ans_sum = (ans_sum * power(factorial(a,mod),mod-2,mod))%mod;
  ans_sum = (ans_sum * power(factorial(b,mod),mod-2,mod))%mod;
  ans_sum = (ans_sum * power(factorial(c,mod),mod-2,mod))%mod;

  printf("%lld\n",ans_sum);

  return true;
}

int main(){

  factorial_init(3000000);
  
  while(solve());
  
  return 0;
}