Given two array A and B of length 5. You have 5 problems to solve in a contest. For \(i^{th}\) problem you need exactly \(A_i\) minutes to solve. But you can't concentrate on \(i^{th}\) problem for more than \(B_i\) minutes continuously. Find number of ways to schedule the \(\sum_{i=1}^{5}A_i\) minutes so that you will solve all the 5 problems (mod \(10^9 + 7\))? Scheduling means for each minute, you have to decide on which problem you will concentrate during that minute.
Two schedules are considered different if at-least for one of the \(\sum_{i=1}^{5}A_i\) minutes, you are concentrating on different problems in both the schedules.
Input Format:
First line contains 5 space separated integers, denoting \(A_i\) \((1 \le A_i \le 10)\). Second line contains 5 space separated integers, denoting \(B_i\) \((1 \le B_i \le 10)\).
Output Format:
Find number of ways to schedule the \(\sum_{i=1}^{5}A_i\) minutes so that you will solve all the 5 problems (mod \(10^9 + 7\))