Count the black-or-white colorings of an N by M grid where every X by Y subrectangle contains both colors.
You have an N×MN \times MN×M grid of 1×11 \times 11×1 cells. You color every cell black or white. No rectangle of XXX rows and YYY columns may end up in a single color, so every X×YX \times YX×Y rectangle cut from the grid has to contain at least one black cell and at least one white cell.
Write a program that counts the colorings satisfying this rule.
The first line contains NNN, MMM, XXX, and YYY, separated by spaces (1≤X≤31 \le X \le 31≤X≤3, 2≤Y≤M2 \le Y \le M2≤Y≤M).
The ranges of NNN and MMM depend on XXX.
Print the number of colorings modulo 1,000,000,007 on the first line.