AlgoUniversity
  • Go Back
Discussion
Number Of Arrangements :

Author

Yash Sahijwani

Difficulty Level : Medium

Submissions : 418

Asked In : PhonePe

Marks :10

: 4 | : 0

Your friend's birthday is nearby. He asked you to take care of balloon decoration. He has bought White and Yellow balloons of $$$N$$$ and $$$M$$$ quantities respectively. You have to decorate the balloons by placing the balloons in a straight line in any order. He likes a decoration when there are no more than $$$W$$$ white balloons placed successively and there are no more than $$$Y$$$ yellow balloons placed successively.

Your friend wants to know the number of decorations that are possible from given input such that he likes the decorations. Output the answer modulo $$$10^9+7$$$.

Input

The first line of input consists of 4 space separated integers $$$-$$$ $$$N, M, W, Y$$$ $$$(1 \leq N, M \leq 100)$$$ $$$(1 \leq W, Y \leq 10)$$$

Output

The output should consist of a single integer - the total number of possible decorations modulo $$$10^9 + 7$$$.

Examples

Input
2 1 1 10
Output
1
Input
2 3 1 2
Output
5

Note

A line filled with balloons in any order is considered as a decoration.

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.