mod = 10**9 + 7 def power(a, b, m): p = a Answer = 1 for i in range(100): if (b>>i)&1: Answer = (Answer*p) % m p = (p*p) % m return Answer N,P =map(int,input().split()) cnt = 1 for i in range(1,N+1): cnt *= i cnt %= mod num = 0 i = P while i <= N: num += N//i i = i**2 print(num*power(cnt,cnt,mod)%mod)