eolymp
bolt
Try our new interface for solving problems
Problems

Lunar Code 2

Lunar Code 2

One may recall that a method of data encoding now known as lunar code was invented by lunar programmers during the defensive war against Martians. Even nowadays its slightly modified version is used by the Lunars in the data transmission. The data is represented in the form of matrix \textbf{M}×\textbf{N} containing ones and zeroes. The transferred matrix must satisfy the following check condition: exactly \textbf{K} of its rows and exactly \textbf{L} of its columns should contain zeroes only. If the received matrix does not satisfy this condition, then the data is considered to be corrupted during the transmission. The Minister of Communications proposed to change the lunar code in his report for the President of the Lunar Federation. He claimed that the number of different messages that can be transmitted is not big enough. The president ordered the Ministry and the Lunar Academy of Sciences to research this question and to decide whether the code should be changed. It turned out that the minister was wrong because the number of binary matrices \textbf{M}×\textbf{N} satisfying the check condition is huge for big enough \textbf{M} and \textbf{N}. Can you calculate this number? \InputFile The only input line contains \textbf{4} integers separated with space: \textbf{M}, \textbf{N}, \textbf{K}, \textbf{L} (\textbf{1} ≤ \textbf{M}, \textbf{N} ≤ \textbf{100000}, \textbf{0} ≤ \textbf{K} ≤ \textbf{M}, \textbf{0} ≤ \textbf{L} ≤ \textbf{N}). \OutputFile Output the number of matrices modulo \textbf{10^9+7}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2 2 0 0
Output example #1
7
Author Igor Chevdar
Source Ural SU Contest. Petrozavodsk Summer Session, August 2008