# Triangles

How many triple of points $$A(x_A, y_A), B(x_B, y_B), C(x_C, y_C)$$ which:

• $$x_A, y_A, x_B, y_B, x_C, y_C \in \mathbb{Z}$$

• $$0 \leq x_A, x_B, x_C < n, 0 \leq y_A, y_B, y_C < m$$

• $$S_{\triangle ABC} \not\in \mathbb{Z}$$? ($$S_\triangle$$ denotes the area of triangle)

## Input

Two integers $$n$$ and $$m$$.

($$1 \leq n, m \leq 10^9$$)

## Output

The only integer denotes the number possible triples, modulo $$10^9 + 7$$.

## Sample input

2 2 

## Sample output

24

## Note

There are $$4$$ triangles. Each of them is counted $$6$$ times.

## Source

Contest #3 on acdream oj by ftiasch