#000500

Kvadratici

In planar rectangular integer grid dimension n x m (are nm squares). How many different squares are in this grid which have corners on integer coordinate (sides of this squares doesn't have to be parallel with sides of grid) ?



Input In first and only row of standard input are two numbers n and m - dimension of rectangular grid (1 <= n, m <= 10^9).


Output Let K be needed number of squares. On standard input write modulo with division K with 10^9 + 7.



Notes:
In 40% tests 1 <= n, m <= 100
In 60% tests 1 <= n, m <= 1.000
In 80% tests 1 <= n, m <= 1.000.000




Input:
2 3

Output:
10




Input:
500 501

Output:
271062715

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.