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 <bits/stdc++.h>

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

typedef pair<int, int> Pi;
typedef tuple<int, int, int> Ti;
typedef vector<int> vint;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

#define MAX_N 3000003

inline int modPow(int x, int n) {
  if(n == 0) return 1;
  int res = modPow(x, n/2);
  (res *= res) %= mod;
  if(n&1) (res *= x) %= mod;
  return res;
}
inline int modInv(int a) {
  return modPow(a, mod-2);
}
inline int modComb(int n, int r) {
  static int fact[MAX_N], inv[MAX_N];
  if(fact[0] == 0) {
    fact[0] = inv[0] = 1;
    reps(i, 1, MAX_N) {
      fact[i] = fact[i-1]*i % mod;
      inv[i] = modInv(fact[i]);
    }
  }
  if(r < 0 || n < r) return 0;
  return fact[n]*inv[r]%mod*inv[n-r]%mod;
}
inline int Homo(int n, int r) {
  return modComb(n+r-1, r);
}

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int A, B, C, Sx, Sy;
  while(cin >> A >> B >> C >> Sx >> Sy, A || B || C || Sx || Sy) {
    if(Sx < Sy || (Sx == Sy && A < B)) swap(Sx, Sy), swap(A, B);
    int diff = Sx - Sy;
    int game = modComb(A+B+C, A)*modComb(B+C, B)%mod; // ????????????????????´????????°
    int score = 0; // ?????°????????????????????´????????°
    if(A == 0) {
      if(B == 0 && Sx == Sy) score = Homo(C, Sx);
    } else if(B == 0) {
      score = Homo(A, diff-A)*Homo(A+B+C, Sy)%mod; // Y????????????????????????????????????+1?????\???
    } else {
      reps(i, max(A, diff+B), Sx+1) {
	score += Homo(A, i-A)*Homo(B, i-diff-B)%mod*Homo(A+B+C, Sx-i)%mod;
	score %= mod;
      }
    }
    cout << game*score%mod << endl;
  }

  return 0;
}