M=1000000007 def fact(n) r=1 (2..n).each{|i|r=r*i%M} r end def totient(n) n.prime_division.reduce(1){|s,e|s*(e[0]-1)*e[0]**(e[1]-1)} end n,m=gets.split.map &:to_i p 2*fact(n-2)*(2..n/m).reduce(0){|s,i|s+totient(i)}%M