Under construction

Still being built. Things may change

A Boring Lesson with Four Squares

Time limit1sMemory limit1024 MB

Summary
Count the ways to place four non-overlapping squares, one in each corner of an M by N sheet, modulo 1e9+7.
Level

Medium7 of 10

Topics
Math, Combinatorics
Solved
No attempts yet

Problem

Juku is bored in class, so he draws squares on graph paper. To be exact, he draws exactly four squares on every sheet, one in each corner of the sheet. The squares may not overlap each other (but they may touch). Juku tries to draw the squares so that each result differs from all the previous ones. How many sheets of paper can he use up this way?

Input

The only line of the input file contains two integers MM and NN (2≤M≤1072 \le M \le 10^7, 2≤N≤1072 \le N \le 10^7), the dimensions of Juku's graph paper.

Output

The only line of the output file contains one integer: the number of ways to draw four non-overlapping squares. The number of ways may be large, and Juku's notebook is very thick, so print the answer modulo 109+710^9 + 7.

Examples3

  1. Example 1

    Input
    2 2
    
    Expected output
    1
    
  2. Example 2

    Input
    3 4
    
    Expected output
    9
    
  3. Example 3

    Input
    512 512
    
    Expected output
    556445640