let rec power ( * ) e m n =
  if n <= 0 then e
  else power ( * ) (if n land 1 = 0 then e else m * e) (m * m) (n lsr 1)

let m = 1000000007
let ( +^ ) x y = (x + y) mod m
let ( -^ ) x y = x +^ (m - y)
let ( *^ ) x y = (x * y) mod m

let () = Scanf.scanf "%d %d" @@ fun n k ->
  let ds = Array.init k succ in
  for d = 1 to k do
    for i = 2 to k / d do
      ds.(d * i - 1) <- ds.(d * i - 1) -^ ds.(d - 1)
    done
  done;
  Printf.printf "%d\n" @@
  Array.fold_left ( +^ ) 0 @@
  Array.init k @@ fun d ->
    power ( *^ ) ds.(d) (k / (d + 1)) n