Under construction

Still being built. Things may change

Product of GCDs

Time limit5sMemory limit512 MB

Summary
Compute the product of gcd(i, j) over all pairs 1<=i<=N, 1<=j<=M, modulo 1e9+7, with N and M up to 15 million.
Level

Hard8 of 10

Topics
Number theory, Math, Combinatorics, Prefix sum
Solved
No attempts yet

Problem

You are given NN and MM. Write a program that computes the product of gcd⁡(i,j)\gcd(i, j) over every ii from 11 to NN and every jj from 11 to MM.

∏i=1N∏j=1Mgcd⁡(i,j)\prod_{i=1}^{N}\prod_{j=1}^{M}\gcd(i, j)

Input

The first line contains NN and MM, separated by a space. (1≤N,M≤15,000,0001 \le N, M \le 15{,}000{,}000)

Output

Print the product modulo 109+710^9 + 7 on the first line.

Examples2

  1. Example 1

    Input
    4 4
    
    Expected output
    96
    
  2. Example 2

    Input
    2 3
    
    Expected output
    2