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 <iostream>
#include <utility>
using namespace std;
#define MOD 1000000007


long long kaijo[5000001];
long long inv[5000001];



long long mul(long long x,long long y){
    return (x*y)%MOD;
}

long long bekijo(long long x,long long n){
    if(n==0)return 1;
    if(n%2==1)return mul(x,bekijo(x,n-1));
    return mul(bekijo(x,n/2),bekijo(x,n/2));
}

long long nCk(int n,int k){
    if(k==-1)return n==k?1:0;
    return mul(kaijo[n],mul(inv[k],inv[n-k]));
}

int main(void){
    kaijo[0]=1;
    for(long long i=1;i<=5000000;i++){
        kaijo[i]=mul(kaijo[i-1],i);
    }
    
    inv[5000000]=bekijo(kaijo[5000000],MOD-2);
    for(long long i=5000000-1;i>=0;i--){
        inv[i]=mul(inv[i+1],i+1);
    }
    
    while(1){
        long long int A,B,C,Sx,Sy;
        scanf("%lld%lld%lld%lld%lld",&A,&B,&C,&Sx,&Sy);
        if(A+B+C==0)break;
        
        /*引き分けた総得点をi点とするとチームXがA回の試合で合計Sx-i点勝ってYがB回の試合でSy-i点勝った*/
        /*Sx-i>=AかつSy-i>=Bのときのみ考える、つまりiの範囲は0からmin(Sx-A,Sy-B)*/
        /*勝ち点の振り分け方はSx-i点をA個の箱に全部最低1個ずつ振り分ける方法なので(Sx-i-1)C(A-1)*/
        /*同様に負け点の振り分けは(Sy-i-1)C(B-1)*/
        /*引き分け点の振り分けはA+B+C個の箱に(0個も許して)分ける方法なので(i+1)H(A+B+C-1)=(i+A+B+C-1)C(A+B+C-1)*/
        /*さらに勝った試合AをA+B+C個のどこに置き、BをB+Cのどこに置くかで(A+B+C)CA * (B+C)CB通り*/
        
        long long ans=0;
        for(int i=0;i<=min(Sx-A,Sy-B);i++){
            long long po=1;
            po=mul(po,nCk(Sx-i-1,A-1));
            po=mul(po,nCk(Sy-i-1,B-1));
            po=mul(po,nCk(i+A+B+C-1,A+B+C-1));
            po=mul(po,nCk(A+B+C,A));
            po=mul(po,nCk(B+C,B));
            ans+=po;
            ans%=MOD;
        }
        printf("%lld\n",ans);
        
    }
    
    
    return 0;
}