1733 - LL && Prime Matrix

Time Limit : 1 Second

Memory Limit : 64 MB

Submission: 0

Solved: 0

Description

Wust_LL  is a math dalao(Chinglish). One day, he define a function: f(i,j), the value of which equals to the sum of all prime numbers which can divide LCM(i,j). LCM(i,j) means the Lowest Common Multiple of integer i and integer j.


Now Wust_LL  gets a Matrix with n rows and m columns. The value 


of Matrix[i][j]=f(i,j). He wants to know the sum of the Matrix[i][j](1≤i≤n,1≤j≤m). 


 

Input

Each test case contains only one line with two integers n,m(1≤n,m≤10^6)

Output

For each case, output an answer modulo 10^9+7.

sample input
2 2
4 2
sample output
6
18
hint

we assume  is not a prime.

source
WUST
© 2015 HUST ACMICPC TEAM. All Right Reserved.