403550: GYM101193 A Street magic
Description
Ladies and gentlemen, David Blaine is back! Having realized that street magic is not as captivating to his audience as in the beginning of his career, David started having doubts about his capabilities. However after giving it another thought he understood that math magic is the new trend in the entertainment industry. We all know David does not bother about easy stuff and he loves stunning the crowd, so he decided to do a famous, but not yet performed by anyone trick with tens.
Here are the trick details. Two people from the audience pick an integer number each. Let's denote these numbers n and m. After that David calculates in his head the secret number x (it takes precisely 0.42 seconds). So what is so special about x? It is a positive integer number not greater n such that for any k > 0. David found out that there could be very many such numbers, so he wants to know exactly how many exist for given n and m.
Note: is modulo operation which finds the remainder after division of one number by another.
InputThe first input line contains two positive integer numbers n and m which were picked by the audience.
The only output line should contain the number of possible secret numbers x modulo 109 + 7 for the given n and m.
ExampleInput72 4Output
42