Yet Another Counting Problem
After saving up for a while, MAPS is finally rich. They decided to buy a new office far away from the Woodside building. Their new office has a massive window shaped like an n * m grid.
To make the office as beautiful as possible, they decided to paint each individual cell of the window with one of 4 colours. A colouring is called beautiful if any two cells that share a common edge or corner are painted with different colours.
Colourings are consider different if there is a cell where the colours are different between the colourings.
Now Parsa wonders, how many ways are there to colour the window beautifully?
Since the answer may be large, print your answer modulo 10^9 + 7.
Input Format:
The first line are integers n and m.Output:
Output the number of unique colourings.Sample Input:
2 2
Sample Output:
24