AtCoder Beginner Contest 132 - Small Products

Find the number of sequences of length K consisting of positive integers such that the product of any two adjacent elements is at most N, modulo 10^9+7.

-----Constraints-----
 - 1\leq N\leq 10^9
 - 1 2\leq K\leq 100 (fixed at 21:33 JST)
 - N and K are integers.

-----Input-----
Input is given from Standard Input in the following format:
N K

-----Output-----
Print the number of sequences, modulo 10^9+7.

-----Sample Input-----
3 2

-----Sample Output-----
5

(1,1), (1,2), (1,3), (2,1), and (3,1) satisfy the condition.

Source: atcoder | Difficulty: MEDIUM_HARD


Solutions:
(n, k) = map(int, input().split())
mod = 10 ** 9 + 7
data = [i for i in range(1, int(n ** 0.5) + 1)] + [n // i for i in range(int(n ** 0.5), 0, -1)]
L = len(data)
dp = [1] * L
for i in range(1, L):
	dp[i] = data[i] - data[i - 1]
for i in range(k - 1):
	h = dp[:]
	for i in range(1, L):
		h[i] = (h[i] + h[i - 1]) % mod
	h = h[::-1]
	for i in range(1, L):
		h[i] = h[i] * (data[i] - data[i - 1]) % mod
	dp = h
ans = 0
for u in dp:
	ans = (ans + u) % mod
print(ans)


from itertools import accumulate
(N, K) = map(int, input().split())
As = []
for i in range(1, int(N ** 0.5) + 1):
	As.append(i)
	if N // i != i:
		As.append(N // i)
As = sorted(As, reverse=False)
nums = []
for i in range(len(As) - 1):
	nums.append(As[i + 1] - As[i])
nums = [1] + nums
nums.reverse()
mod = 10 ** 9 + 7
ans = 0
dp = [[0] * len(As) for i in range(K + 1)]
dp[0][0] = 1
for i in range(K):
	acc = list(accumulate(dp[i]))
	for j in range(len(As)):
		dp[i + 1][len(As) - j - 1] = acc[j] * nums[j] % mod
print(sum(dp[K]) % mod)


(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
n = int(N ** 0.5)
dp1 = [[0] * (n + 1) for _ in range(K)]
dp2 = [[0] * (n + 1) for _ in range(K)]
for i in range(1, n + 1):
	dp1[0][i] = 1
dp2[0][n] = N // n - n
for i in range(1, n):
	dp2[0][i] = (N // i - N // (i + 1)) % mod
for i in range(1, K):
	cum = 0
	for j in range(1, n + 1):
		dp2[i][j] = (dp1[i - 1][j] + cum) % mod * dp2[0][j] % mod
		cum += dp1[i - 1][j]
		cum %= mod
	for j in range(1, n + 1)[::-1]:
		dp1[i][j] = (cum + dp2[i - 1][j]) % mod
		cum += dp2[i - 1][j]
		cum %= mod
print((sum(dp1[-1]) % mod + sum(dp2[-1]) % mod) % mod)


import sys
sys.setrecursionlimit(10 ** 7)
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right
from collections import deque
from collections import Counter
from itertools import accumulate, combinations, permutations
from heapq import heapify, heappop, heappush
from functools import lru_cache
from decimal import Decimal

def input():
	x = sys.stdin.readline()
	return x[:-1] if x[-1] == '\n' else x

def printe(*x):
	print('## ', *x, file=sys.stderr)

def printl(li):
	_ = print(*li, sep='\n') if li else None

def argsort(s, return_sorted=False):
	inds = sorted(range(len(s)), key=lambda k: s[k])
	if return_sorted:
		return (inds, [s[i] for i in inds])
	return inds

def alp2num(c, cap=False):
	return ord(c) - 97 if not cap else ord(c) - 65

def num2alp(i, cap=False):
	return chr(i + 97) if not cap else chr(i + 65)

def matmat(A, B):
	(K, N, M) = (len(B), len(A), len(B[0]))
	return [[sum([A[i][k] * B[k][j] for k in range(K)]) for j in range(M)] for i in range(N)]

def matvec(M, v):
	(N, size) = (len(v), len(M))
	return [sum([M[i][j] * v[j] for j in range(N)]) for i in range(size)]

def T(M):
	(n, m) = (len(M), len(M[0]))
	return [[M[j][i] for j in range(n)] for i in range(m)]

def main():
	mod = 1000000007
	(N, K) = map(int, input().split())
	l = 1
	from collections import defaultdict
	dp = dict()
	ndp = defaultdict
	for i in range(K):
		ndp = dict()
		l = N
		s = 0
		while l > 0:
			d = N // l
			r = N // (d + 1)
			if i == 0:
				s = 1
			else:
				s += dp[d]
			ndp[l] = (l - r) * s % mod
			l = r
		dp = ndp
	ans = 0
	for v in dp.values():
		ans = ans + v
		ans %= mod
	print(ans)
main()


import numpy as np
(n, k) = list(map(int, input().split()))
MOD = 10 ** 9 + 7
l = int(n ** 0.5)
coe = []
for i in range(l, 0, -1):
	coe.append(n // i - l)
coe.append(0)
coe.reverse()
coe = np.array(coe, dtype=np.int64)
dp1 = np.ones(l + 1, dtype=np.int64)
dp2 = coe.copy()
dp1[0] = 0
for i in range(k - 1):
	dp1acc = np.add.accumulate(dp1) % MOD
	dp12acc = np.add.accumulate((dp1 * coe % MOD)[::-1])[::-1]
	s = dp1acc[-1]
	dp1acc = np.roll(dp1acc, 1)
	dp1acc[0] = 0
	dp12acc[0] = 0
	dp1[1:] = (s + dp2[1:]) % MOD
	dp2 = dp12acc + dp1acc * coe % MOD
ans = (dp1.sum() + dp2[1]) % MOD
print(ans)


from itertools import accumulate
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
xs = []
x = 1
while x * x <= N:
	xs.append(N // x)
	x += 1
s = x - 1
y = 1
while y < N // y:
	xs.append(y)
	y += 1
xs = list(set(xs))
xs.sort()
compress = {x: i for (i, x) in enumerate(xs)}
dp = [[0] * len(compress) for _ in range(K)]
for (x, i) in compress.items():
	dp[-1][i] = x
for k in range(K - 1)[::-1]:
	cum = list(accumulate([0] + dp[k + 1]))
	for (x, i) in compress.items():
		a = max(compress[N // x], compress[N // s])
		dp[k][i] = (cum[-1] - cum[a]) % mod
	b = 1
	cum = [0] * len(compress)
	while b < N // b:
		cnt = N // b - N // (b + 1)
		cum[compress[b]] = (cum[compress[b]] + cnt * dp[k + 1][compress[b]]) % mod
		b += 1
	cum = list(accumulate([0] + cum))
	for (x, i) in compress.items():
		b = N // x
		if x <= b:
			continue
		dp[k][i] += cum[-1] - cum[compress[b] + 1]
		dp[k][i] += (x - N // (b + 1)) * dp[k + 1][compress[b]]
		dp[k][i] %= mod
print(dp[0][-1])


from bisect import bisect_left
from math import sqrt
MOD = 10 ** 9 + 7

def main():
	(lim, n) = map(int, input().split())
	(num, tmp) = ([], [])
	for i in range(1, int(sqrt(lim)) + 1):
		num.append(i)
		if i ** 2 != lim:
			tmp.append(lim // i)
	while len(tmp) > 0:
		num.append(tmp.pop(-1))
	m = len(num)
	dp = [[0] * m for _ in range(n)]
	dp[0][0] = 1
	for j in range(1, m):
		dp[0][j] = num[j] - num[j - 1]
	for i in range(1, n):
		for j in range(1, m):
			dp[i - 1][j] += dp[i - 1][j - 1]
		for j in range(m):
			idx = bisect_left(num, lim // num[j])
			p = num[j]
			if j > 0:
				p -= num[j - 1]
			dp[i][j] = dp[i - 1][idx] * p % MOD
	print(sum(dp[-1]) % MOD)
main()


Q = 10 ** 9 + 7
from collections import deque
from itertools import accumulate

def main():
	(N, K) = map(int, input().split())
	ans = 0
	d = deque()
	e = deque()
	M = int(N ** (1 / 2)) * 2
	for i in range(1, int(N ** (1 / 2)) + 1):
		if i ** 2 == N:
			d.append(i)
			M -= 1
			continue
		d.append(i)
		e.appendleft(N // i)
	T = list(d) + list(e)
	CT = [1] * M
	for i in range(1, M):
		CT[i] = T[i] - T[i - 1]
	accT = list(map(lambda x: x % Q, accumulate(CT)))
	dp = [[0] * M for _ in range(K)]
	for i in range(M):
		dp[1][i] = accT[-i - 1] * CT[i] % Q
	for k in range(1, K - 1):
		accT[0] = dp[k][0]
		for i in range(M - 1):
			accT[i + 1] = (accT[i] + dp[k][i + 1]) % Q
		for i in range(M):
			dp[k + 1][i] = accT[-i - 1] * CT[i] % Q
	print(sum(dp[K - 1]) % Q)
main()


(n, k) = [int(x) for x in input().split()]
mod = 1000000007
if n == 1:
	print(1)
	quit()
f = [0, n]
i = 1
while f[i] >= i:
	i += 1
	f.append(n // i)
s = [0] * len(f)
for i in range(1, len(f)):
	s[i] = 1
for i in range(2, len(f))[::-1]:
	if f[i] <= i:
		s[-1] = f[i - 1] - f[i]
	else:
		s.append(f[i - 1] - f[i])
MA = len(s)
dp = [[0] * MA for i in range(k)]
dp[0] = [s[i] for i in range(MA)]
for i in range(MA - 1):
	dp[0][i + 1] += dp[0][i]
	dp[0][i + 1] %= mod
for l in range(k - 1):
	for i in range(1, MA):
		j = MA - i
		dp[l + 1][i] += dp[l][j] * s[i]
		dp[l + 1][i] %= mod
		dp[l + 1][i] += dp[l + 1][i - 1]
		dp[l + 1][i] %= mod
print(dp[-1][-1])


(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
Layer = []
a = 1
b = 1
while b <= N:
	a = b
	b = N // (N // a) + 1
	Layer.append((a, b))
num = [x[1] - x[0] for x in Layer]
M = len(Layer)
dp = [[0 for j in range(M + 1)] for i in range(K + 1)]
dp[0][0] = 1
sdp = [0 for i in range(M + 2)]
for k in range(K):
	for j in range(M + 1):
		sdp[j + 1] = (dp[k][j] + sdp[j]) % mod
	for j in range(M):
		dp[k + 1][j] = sdp[M - j] * num[j] % mod
ans = 0
for j in range(M + 1):
	ans += dp[K][j]
	ans %= mod
print(ans)


from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string
INF = float('inf')

def LI():
	return list(map(int, sys.stdin.readline().split()))

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return sys.stdin.readline().strip()

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]

def SRL(n):
	return [list(S()) for i in range(n)]

def MSRL(n):
	return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7
(n, k) = LI()
sqt = int(n ** 0.5)
dp_mul_num = [1] * sqt + [n // i - n // (i + 1) for i in range(1, n // sqt)][::-1]
group_num = len(dp_mul_num)
dp = [[0] * group_num for _ in range(k)]
dp[0] = dp_mul_num
for i in range(k - 1):
	ret = 0
	for j in range(group_num):
		ret = (ret + dp[i][j]) % mod
		dp[i + 1][group_num - j - 1] = ret * dp_mul_num[group_num - j - 1] % mod
print(sum(dp[-1]) % mod)


import sys
input = sys.stdin.readline
(N, K) = map(int, input().split())
P = 110000
MOD = 10 ** 9 + 7
S = [0] * P
dp = [[0] * P for i in range(110)]
num = [0] * P
i = 1
t = 0
while i <= N:
	j = N // i
	if i <= j:
		num[t] = 1
		t += 1
		i += 1
	else:
		num[t] = N // j - i + 1
		i = N // j + 1
		t += 1
dp[0][0] = 1
for k in range(K):
	S = [0] * P
	for j in range(t + 1):
		S[j + 1] = S[j] + dp[k][j]
		S[j + 1] %= MOD
	for j in range(t):
		dp[k + 1][j] = S[t - j] * num[j]
		dp[k + 1][j] %= MOD
ans = 0
for i in range(t + 1):
	ans += dp[K][i]
	ans %= MOD
print(ans)


import sys

def solve():
	(N, K) = map(int, input().split())
	MOD = 10 ** 9 + 7
	U = []
	V = []
	for x in range(1, int(N ** 0.5) + 1):
		U.append(x)
		if x < N // x:
			V.append(N // x)
	V.reverse()
	U.extend(V)
	L = len(U)
	prv = 0
	R = []
	for x in U:
		R.append(x - prv)
		prv = x

	def gen(R, S):
		r = 0
		for (p, s) in zip(R, S):
			r = (p * s + r) % MOD
			yield r
	S = [1] * (L + 1)
	S[-1] = 0
	for k in range(K):
		S[L - 1::-1] = gen(R, S)
	print(S[0])
solve()


import bisect
import heapq
import sys
import itertools
import queue
input = sys.stdin.readline
sys.setrecursionlimit(100000)
mod = 10 ** 9 + 7

class V:

	def __init__(self, f):
		self.f = f
		self.v = None

	def __str__(self):
		return str(self.v)

	def ud(self, n):
		if self.v is None:
			self.v = n
		else:
			self.v = self.f(self.v, n)

	def get(self):
		return self.v

def read_values():
	return map(int, input().split())

def read_list():
	return list(read_values())

def P(N):
	D = []
	for n in range(1, int(N ** 0.5) + 1):
		D.append(n)
		if N // n != n:
			D.append(N // n)
	D.sort()
	return D

def main():
	(N, K) = read_values()
	D = P(N)
	C = [(D[i] - D[i - 1]) % mod if i != 0 else D[i] for (i, d) in enumerate(D)]
	dp = [0] * len(D)
	S = [D] + [[0] * len(D) for k in range(K - 1)]
	I = [bisect.bisect_left(D, N // d) for d in D]
	for k in range(1, K):
		for i in range(len(D)):
			j = I[i]
			dp[i] = S[k - 1][j] * C[i] % mod
			S[k][i] = (S[k][i - 1] + dp[i]) % mod
	print(S[-1][-1] % mod)
main()


(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
rN = int(N ** 0.5)
T = {N // x for x in range(1, rN + 1)}
T |= {x for x in range(1, rN + 1)}
T = [0] + sorted(list(T))
dp = []
dp.append([0] + [T[i] - T[i - 1] for i in range(1, len(T))])
for k in range(K - 1):
	dp.append([0] * len(T))
	dp[-1][-1] = dp[-2][1]
	for t in range(2, len(T)):
		dp[-1][-t] = (dp[-2][t] + dp[-1][-t + 1]) % MOD
	for t in range(len(T)):
		dp[-1][t] = dp[-1][t] * dp[0][t] % MOD
print(sum(dp[-1]) % MOD)


def main():
	import sys
	from math import sqrt
	input = sys.stdin.readline
	mod = 1000000007
	(N, K) = map(int, input().split())
	n = int(sqrt(N))
	dp = [[0] * (2 * n + 1) for _ in range(K + 1)]
	dp[0][1] = 1
	num = [0] * (n + 1)
	for i in range(1, n):
		num[i] = N // i - N // (i + 1)
	num[n] = N // n - n
	for i in range(K):
		cs = dp[i][:n + 1]
		cs2 = dp[i][n + 1:]
		for j in range(1, n + 1):
			cs[j] = (cs[j] + cs[j - 1]) % mod
		for j in range(1, n):
			cs2[j] = (cs2[j] + cs2[j - 1]) % mod
		for j in range(1, n + 1):
			dp[i + 1][-j] = cs[j] * num[j] % mod
			dp[i + 1][j] = (cs2[-j] + cs[n]) % mod
	ans = 0
	for a in dp[-1]:
		ans = (ans + a) % mod
	print(ans)
main()


def guchoku(n, k, mod):
	dp = [1] * (n + 1)
	dp[0] = 0
	for _ in range(k - 1):
		ndp = [0] * (n + 1)
		for i in range(1, n + 1):
			ndp[i] += sum([dp[j + 1] for j in range(n // i)])
			ndp[i] %= mod
		dp = ndp.copy()
	return sum(dp) % mod

def main(n, k, mod):
	ary = []
	tmp = 0
	for i in range(1, int(n ** 0.5) + 1):
		ary.append(n // i - n // (i + 1))
		tmp += ary[-1]
	tmp = n - tmp
	ary += [1] * tmp
	ary.reverse()
	dp = [x for x in ary]
	m = len(ary)
	for i in range(m - 1):
		dp[i + 1] += dp[i]
		dp[i + 1] %= mod
	for _ in range(k - 1):
		ndp = [0] * m
		for i in range(m):
			ndp[i] += dp[-i - 1] * ary[i]
			ndp[i] %= mod
			pass
		for i in range(m - 1):
			ndp[i + 1] += ndp[i]
			ndp[i + 1] %= mod
		dp = [x for x in ndp]
	return dp[-1]
(n, k) = map(int, input().split())
mod = 10 ** 9 + 7
print(main(n, k, mod))


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
sys.setrecursionlimit(100000)
input = sys.stdin.readline

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

class Mod:

	def __init__(self, m):
		self.m = m

	def add(self, a, b):
		return (a + b) % self.m

	def sub(self, a, b):
		return (a - b) % self.m

	def mul(self, a, b):
		return a % self.m * (b % self.m) % self.m

	def div(self, a, b):
		return self.mul(a, pow(b, self.m - 2, self.m))

	def pow(self, a, b):
		return pow(a, b, self.m)

@mt
def slv(N, K):
	r = set([0])
	for i in range(1, math.floor(math.sqrt(N)) + 1):
		r.add(N // i)
		r.add(i)
	r = list(r)
	r.sort()
	m = {}
	for i in range(len(r) - 1):
		m[i + 1] = r[i + 1] - r[i]
	DP1 = {k: v for (k, v) in m.items()}
	DP2 = {}
	M = Mod(10 ** 9 + 7)
	for _ in range(K):
		S = [0]
		for k in range(1, len(DP1) + 1):
			S.append(M.add(S[-1], DP1[k]))
		for k in DP1:
			DP2[k] = M.mul(S[len(DP1) - k + 1], m[k])
		(DP1, DP2) = (DP2, DP1)
	ans = 0
	for v in DP2.values():
		ans = M.add(ans, v)
	return ans

def main():
	(N, K) = read_int_n()
	print(slv(N, K))
main()


import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
from collections import deque, Counter, defaultdict

def getN():
	return int(input())

def getList():
	return list(map(int, input().split()))
import math
import copy
import bisect
MOD = 10 ** 9 + 7
from logging import getLogger, StreamHandler, DEBUG, WARNING
logger = getLogger(__name__)
handler = StreamHandler()
handler.setLevel(DEBUG)
logger.setLevel(DEBUG)
logger.addHandler(handler)

def main():
	(n, k) = getList()
	divisors = []
	tmp_div = n + 1
	for i in range(1, int(math.sqrt(n)) + 3):
		if tmp_div * i > n:
			other = n // i
			if i > other:
				break
			elif i == other:
				divisors.append(i)
				break
			else:
				divisors.append(i)
				divisors.append(other)
	divisors.sort()
	n_div = len(divisors)
	diff = [divisors[0]]
	for (i, j) in zip(divisors, divisors[1:]):
		diff.append(j - i)
	dp = copy.copy(diff)
	for iteration in range(k - 1):
		dp_copy = []
		tmp = sum(dp) % MOD
		dp_copy.append(tmp * diff[0] % MOD)
		for (cid, dp_content) in enumerate(range(n_div - 1)):
			tmp -= dp[n_div - dp_content - 1]
			dp_copy.append(tmp * diff[cid + 1] % MOD)
		dp = copy.copy(dp_copy)
	print(sum(dp) % MOD)
main()


from itertools import accumulate
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
sqt = int(N ** 0.5)
cnt = [N // i - N // (i + 1) for i in range(1, N // sqt)] + [1] * sqt
x = cnt
for _ in range(K):
	x = [i * j % mod for (i, j) in zip(accumulate(reversed(x)), cnt)]
print(x[-1])


from math import sqrt
(n, k) = map(int, input().split())
MOD = 10 ** 9 + 7
max1 = int(sqrt(n))
dp1 = [[0 for _ in range(max1 + 1)] for _ in range(k)]
for j in range(1, max1 + 1):
	dp1[0][j] = 1
max2 = int(n / (max1 + 1))
dp2 = [[0 for _ in range(max2 + 1)] for _ in range(k)]
for j in range(1, max2 + 1):
	dp2[0][j] = int(n / j) - int(n / (j + 1))
for i in range(k - 1):
	csum1 = (sum(dp1[i]) + sum(dp2[i])) % MOD
	dp1[i + 1][1] = csum1
	for j in range(2, max1 + 1):
		dp1[i + 1][j] = (dp1[i + 1][j - 1] - dp2[i][j - 1]) % MOD
	csum2 = sum(dp1[i][:max2 + 1]) % MOD
	dp2[i + 1][max2] = csum2 * dp2[0][max2] % MOD
	for j in range(max2 - 1, 0, -1):
		csum2 -= dp1[i][j + 1]
		csum2 %= MOD
		dp2[i + 1][j] = csum2 * dp2[0][j] % MOD
print((sum(dp1[k - 1]) + sum(dp2[k - 1])) % MOD)


from math import sqrt
inpl = lambda : list(map(int, input().split()))
MOD = 10 ** 9 + 7
(N, K) = inpl()
sqN = int(sqrt(N))
bound = [0] * (sqN + 2)
for i in range(1, sqN + 2):
	bound[i] = N // i
bound[sqN + 1] = sqN
group_size = [0] * (sqN + 1)
for i in range(1, sqN + 1):
	group_size[i] = bound[i] - bound[i + 1]
cur_small = [1] * (sqN + 1)
cur_small[0] = 0
cur_large = [s for s in group_size]
for k in range(K - 1):
	prev_small = cur_small
	cur_small = [0] * (sqN + 2)
	prev_large = cur_large
	cur_small = [0] * (sqN + 2)
	cur_small[sqN + 1] = sum(prev_small[:sqN + 1])
	for n in range(sqN, 0, -1):
		cur_small[n] = (prev_large[n] + cur_small[n + 1]) % MOD
	acc_prev_small = 0
	for n in range(1, sqN + 1):
		acc_prev_small += prev_small[n]
		cur_large[n] = acc_prev_small * group_size[n] % MOD
print((sum(cur_small[:sqN + 1]) + sum(cur_large[:sqN + 1])) % MOD)


MOD = pow(10, 9) + 7

def main():
	(n, k) = map(int, input().split())
	dyaku = set([1, n])
	i = 2
	while i * i <= n:
		if n // i not in dyaku:
			dyaku.add(i)
			dyaku.add(n // i)
		i += 1
	reyaku = [0] + list(sorted(dyaku))
	ddyaku = {s: i + 1 for (i, s) in enumerate(sorted(dyaku))}
	dp = [[0 for _ in range(k)] for _ in range(len(dyaku) + 1)]
	for i in range(1, len(dyaku) + 1):
		dp[i][1] = ((reyaku[i] - reyaku[i - 1]) * (n // reyaku[i]) % MOD + dp[i - 1][1]) % MOD
	for i in range(2, k):
		for j in range(1, len(dyaku) + 1):
			dp[j][i] = ((reyaku[j] - reyaku[j - 1]) * dp[ddyaku[n // reyaku[j]]][i - 1] % MOD + dp[j - 1][i]) % MOD
	print(dp[-1][-1])
main()


import numpy as np
(n, k) = list(map(int, input().split()))
mod = 10 ** 9 + 7
m = n ** 0.5
cnt = [n // i - n // (i + 1) for i in range(1, int(m) + 1)]
cnt = np.array((cnt + [1 for _ in range(n - sum(cnt))])[::-1])
nxt = cnt[:]
for _ in range(k - 1):
	cnt = nxt * np.cumsum(cnt)[::-1] % mod
print(sum(cnt) % mod)


import sys
input = sys.stdin.readline
import math
import copy
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
if N == 1:
	ans = 1
else:
	Keys = set()
	for n in range(1, int(math.sqrt(N)) + 2):
		Keys.add(n)
		Keys.add(N // n)
	L = sorted(list(Keys))
	Counts = {1: 1}
	for i in range(len(L) - 1):
		Counts[L[i + 1]] = L[i + 1] - L[i]
	dp = copy.copy(Counts)
	for _ in range(K - 1):
		sdp = {}
		c = 0
		for l in L:
			c = (c + dp[l]) % mod
			sdp[l] = c
		for l in L:
			r = N // l
			dp[l] = sdp[r] * Counts[l] % mod
	ans = 0
	for v in dp.values():
		ans = (ans + v) % mod
print(ans)


MOD = 10 ** 9 + 7

def main(N, K):
	W = []
	i = 1
	while i <= N:
		v = N // i
		j = N // v
		W.append(j - i + 1)
		i += j - i + 1
	l = len(W)
	dp = [0] * l
	total = 0
	for (i, w) in enumerate(W):
		total += w
		dp[l - i - 1] = total
	for i in range(2, K + 1):
		tmp = [0] * l
		total = 0
		for (j, w) in enumerate(W):
			v = dp[j] * w
			total += v
			total %= MOD
			tmp[l - j - 1] = total
		dp = tmp
	return dp[0]

def __starting_point():
	(N, K) = list(map(int, input().strip().split()))
	print(main(N, K))
__starting_point()


(N, K) = map(int, input().split())
P = 10 ** 9 + 7
R = int(N ** 0.5) + 1
A = [i for i in range(R)] + [N // i for i in range(1, R)][::-1]
M = len(A)
X = [0] + [1] * (M - 1)
for i in range(1, K + 1):
	NX = [0] * M
	for j in range(1, M):
		NX[j] = (NX[j - 1] + X[M - j] * (A[j] - A[j - 1])) % P
	X = NX
print(X[-1])


import math
from itertools import accumulate

def cumsum(a):
	return list(accumulate(a))
(n, k) = map(int, input().split())
if n == 1:
	print(1)
	exit()
mod = 10 ** 9 + 7
now = n
big = []
for i in range(2, int(math.sqrt(n) + 2)):
	d = n // i
	big.append(now - d)
	now = d
big.reverse()
l = [1] * d + big
l2 = [1] * d + big
for i in range(k - 1):
	a = cumsum(l)
	a.reverse()
	count = 0
	for (i, j) in zip(a, l2):
		l[count] = i * j % mod
		count += 1
l = cumsum(l)
ans = l[-1] % mod
print(ans)


(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
i = 1
n = []
while i <= N:
	j = N // i
	if i <= j:
		n.append(1)
		i += 1
	else:
		n.append(N // j - i + 1)
		i = N // j + 1
M = len(n)
dp = [[0] * M for _ in range(K)]
dp[0] = n
for k in range(1, K):
	sdp = [0] * M
	sdp[0] = dp[k - 1][0]
	for i in range(1, M):
		sdp[i] = (sdp[i - 1] + dp[k - 1][i]) % MOD
	for i in range(M):
		dp[k][i] = sdp[M - i - 1] * n[i] % MOD
ret = 0
for j in range(M):
	ret += dp[K - 1][j]
	ret %= MOD
print(ret)


import math
(n, k) = map(int, input().split())
mod = 1000000007
n1 = int(math.sqrt(n))
if n1 * n1 == n:
	n2 = n1 - 1
else:
	n2 = n1
num = [n]
for i in range(1, n2):
	num.append(n // (i + 1))
	num[i - 1] -= num[i]
num[-1] -= n1
dp1 = [1 for i in range(n1)]
dp2 = [num[i] for i in range(n2)]
for _ in range(k - 1):
	l = sum(dp1) % mod
	newdp1 = [l for i in range(n1)]
	newdp2 = [0 for i in range(n2)]
	dp1sum = 0
	for j in range(0, n2):
		dp1sum = (dp1sum + dp1[j]) % mod
		newdp2[j] = (newdp2[j] + dp1sum * num[j]) % mod
	dp2sum = 0
	for j in range(n2 - 1, -1, -1):
		dp2sum = (dp2sum + dp2[j]) % mod
		newdp1[j] = (newdp1[j] + dp2sum) % mod
	dp1 = newdp1
	dp2 = newdp2
print((sum(dp1) + sum(dp2)) % mod)


from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return [list(x) for x in sys.stdin.readline().split()]

def S():
	return list(sys.stdin.readline())[:-1]

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007

def A():
	s = S()
	d = defaultdict(int)
	for i in s:
		d[i] += 1
	for i in d.keys():
		if d[i] != 2:
			print('No')
			quit()
	print('Yes')
	return

def B():
	n = I()
	p = LI()
	ans = 0
	for i in range(1, n - 1):
		k = p[i - 1:i + 2]
		k.sort()
		if k[1] == p[i]:
			ans += 1
	print(ans)
	return

def C():
	n = I()
	d = LI()
	d.sort()
	print(d[n // 2] - d[n // 2 - 1])
	return

def D():
	(n, k) = LI()
	fact = [1] * 100001
	for i in range(1, 100001):
		fact[i] = fact[i - 1] * i % mod
	inv = [1] * 100001
	inv[-1] = pow(fact[-1], mod - 2, mod)
	for i in range(1, 100001)[::-1]:
		inv[i - 1] = inv[i] * i % mod
	for i in range(1, k + 1):
		if n - k + 1 < i:
			print(0)
		else:
			ans = fact[n - k + 1] * inv[i] * inv[n - k + 1 - i] % mod
			ans *= fact[k - 1] * inv[k - i] * inv[i - 1] % mod
			ans %= mod
			print(ans)
	return

def E():
	ma = 100000000

	def dijkstra(s):
		d = defaultdict(lambda : ma)
		q = [(0, s, 0)]
		d[s, 0] = 0
		while q:
			(dx, x, t) = heappop(q)
			t = (t + 1) % 3
			k = t == 1
			for y in v[x]:
				if dx + k < d[y, t]:
					d[y, t] = dx + k
					heappush(q, (d[y, t], y, t))
		res = d[g, 0]
		if res == ma:
			res = -1
		return res
	(n, m) = LI()
	v = [[] for i in range(n)]
	for i in range(m):
		(a, b) = LI()
		a -= 1
		b -= 1
		v[a].append(b)
	(s, g) = LI()
	s -= 1
	g -= 1
	print(dijkstra(s))
	return

def F():
	(n, k) = LI()
	if n == 1:
		print(1)
		quit()
	f = [0, n]
	i = 1
	while f[i] >= i:
		i += 1
		f.append(n // i)
	s = [0] * len(f)
	for i in range(1, len(f)):
		s[i] = 1
	for i in range(2, len(f))[::-1]:
		if f[i] <= i:
			s[-1] = f[i - 1] - f[i]
		else:
			s.append(f[i - 1] - f[i])
	MA = len(s)
	dp = [[0] * MA for i in range(k)]
	dp[0] = [s[i] for i in range(MA)]
	for i in range(MA - 1):
		dp[0][i + 1] += dp[0][i]
		dp[0][i + 1] %= mod
	for l in range(k - 1):
		for i in range(1, MA):
			j = MA - i
			dp[l + 1][i] += dp[l][j] * s[i]
			dp[l + 1][i] %= mod
			dp[l + 1][i] += dp[l + 1][i - 1]
			dp[l + 1][i] %= mod
	print(dp[-1][-1])
	return
F()


import numpy as np
(N, K) = list(map(int, input().split()))
MOD = 10 ** 9 + 7
div = list(range(1, int(np.sqrt(N)) + 1))
L1 = len(div)
div2 = [N // val for val in div]
div2.sort()
if div[-1] == div2[0]:
	div2.remove(div2[0])
L2 = len(div2)
L = L1 + L2
ls = [1] * L1 + [0] * L2
tmp = div[-1]
for (i, val) in enumerate(div2):
	ls[i + L1] = val - tmp
	tmp = val
dp = [0] * L
dp = np.zeros(L, dtype='int64')
ls = np.array(ls, dtype='int64')
dp[:] = ls
r = np.zeros(L + 1, dtype='int64')
r[:-1] = np.cumsum(dp, dtype='int64')[::-1]
for i in range(K - 1):
	dp = r[:-1] * ls % MOD
	r[:-1] = np.cumsum(dp, dtype='int64')[::-1]
print(r[0] % MOD)


(n, k) = map(int, input().split())
mod = 10 ** 9 + 7
nums = set()
d = {}
for i in range(1, 10 ** 6):
	a = n // i
	b = 1 + n // (i + 1)
	d[i] = a
	nums.add(i)
	nums.add(a)
	if i >= b:
		break
	d[b] = i
	nums.add(b)
d = sorted(d.items())
dic_en = {}
dic_de = {}
nums = sorted(list(nums))
cnt = [0] * len(nums)
done = 0
for (i, num) in enumerate(nums):
	dic_en[num] = i
	dic_de[i] = num
	cnt[i] = num - done
	done = num
d = []
for num in nums:
	d.append((dic_en[num], dic_en[n // num]))
op = cnt[:]

def update(op):
	n = len(nums)
	res = [0] * (n + 1)
	for (a, b) in d:
		res[0] += op[a]
		res[b + 1] -= op[a]
	res[0] %= mod
	for i in range(1, n):
		res[i] += res[i - 1]
		res[i] %= mod
	for i in range(n):
		res[i] *= cnt[i]
		res[i] %= mod
	return res[:-1]
for i in range(k - 1):
	op = update(op)
ans = sum(op) % mod
print(ans)


import numpy as np
(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
M = int(N ** 0.5)
upper_cnt = np.zeros(M + 1, dtype=np.int64)
a = np.arange(M + 1, dtype=np.int64)
upper_cnt[1:] = N // a[1:] - np.maximum(M, N // (a[1:] + 1))
lower = np.zeros(M + 1, dtype=np.int64)
upper = np.zeros(M + 1, dtype=np.int64)
lower[1] = 1
for k in range(1, K + 1):
	prev_lower = lower
	prev_upper = upper
	cum_lower = prev_lower.cumsum() % MOD
	cum_upper = prev_upper.cumsum() % MOD
	lower = np.zeros(M + 1, dtype=np.int64)
	lower += cum_lower[-1] + cum_upper[-1]
	lower[1:] -= cum_upper[:-1]
	lower[0] = 0
	upper = cum_lower * upper_cnt
	lower %= MOD
	upper %= MOD
answer = (lower.sum() + upper.sum()) % MOD
print(answer)


from itertools import accumulate
MOD = 10 ** 9 + 7
(N, K) = list(map(int, input().split()))

def N2sqrtN(N):
	M = int(N ** 0.5)
	As = list(range(1, M + 1))
	Bs = [N // A for A in reversed(As)]
	if As[-1] == Bs[0]:
		return As + Bs[1:]
	else:
		return As + Bs
Bs = N2sqrtN(N)
lenB = len(Bs)
nums = [1]
for i in range(lenB - 1):
	nums.append(Bs[i + 1] - Bs[i])
dp = [0] * lenB
dp[0] = 1
for i in range(1, K + 1):
	dp = list(accumulate(dp))
	dp = [dpi * num % MOD for (dpi, num) in zip(reversed(dp), nums)]
print(sum(dp) % MOD)


from itertools import accumulate
(n, k) = map(int, input().split())
x = int(n ** 0.5)
mod = 10 ** 9 + 7
if x * (x + 1) <= n:
	flg = 1
else:
	flg = 0
t = 2 * x + flg
dp = [[0 for i in range(t)] for j in range(2)]
for i in range(1, t):
	if i <= x:
		dp[0][i] = 1
		dp[1][i] = 1
	else:
		p = t - i
		dp[0][i] = n // p - n // (p + 1)
		dp[1][i] = n // p - n // (p + 1)
dp[1] = list(accumulate(dp[1]))
for i in range(2, k + 1):
	dp[1][1:] = dp[1][t:0:-1]
	for j in range(1, t):
		dp[1][j] = dp[1][j] * dp[0][j] % mod
	for j in range(1, t):
		dp[1][j] = (dp[1][j] + dp[1][j - 1]) % mod
print(dp[1][t - 1])


(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
lis = []
lis2 = []
i = 1
while i ** 2 <= N:
	if N // i != i:
		lis.append(i)
		lis2.append(N // i)
	else:
		lis.append(i)
	i += 1
lis2.reverse()
lis += lis2
dp = [0] * len(lis)
for i in range(len(lis)):
	if i == 0:
		dp[i] = 1
	else:
		dp[i] = lis[i] - lis[i - 1]
for loop in range(K):
	ndp = [0] * len(lis)
	nsum = 0
	for i in range(len(lis)):
		nsum += dp[i]
		nsum %= mod
		if i != len(lis) - 1:
			ndp[-1 - i] += (lis[-1 - i] - lis[-2 - i]) * nsum % mod
		else:
			ndp[-1 - i] += nsum % mod
	dp = ndp
print(dp[0])


import sys

def solve():
	input = sys.stdin.readline
	(N, K) = map(int, input().split())
	mod = 7 + 10 ** 9
	S = 1
	while S ** 2 <= N:
		S += 1
	DP = [[[0, 0] for _ in range(S)] for _ in range(K)]
	Rev = [0] * S
	S -= 1
	Rev[S] = (N // S - S) % mod
	for i in reversed(range(1, S)):
		Rev[i] = (N // i - N // (i + 1)) % mod
	for i in range(1, S + 1):
		DP[0][i][0] = 1
		DP[0][i][1] = Rev[i]
	for i in range(2, S + 1):
		DP[0][i][0] += DP[0][i - 1][0]
		DP[0][i][0] %= mod
	DP[0][S][1] += DP[0][S][0]
	DP[0][S][1] %= mod
	for i in reversed(range(1, S)):
		DP[0][i][1] += DP[0][i + 1][1]
		DP[0][i][1] %= mod
	for i in range(1, K):
		for j in range(1, S + 1):
			DP[i][j][0] += DP[i - 1][j][1]
			DP[i][j][1] += DP[i - 1][j][0] * Rev[j] % mod
			DP[i][j][1] %= mod
			DP[i][j][0] += DP[i][j - 1][0]
			DP[i][j][0] %= mod
		DP[i][S][1] += DP[i][S][0]
		DP[i][S][1] %= mod
		for j in reversed(range(1, S)):
			DP[i][j][1] += DP[i][j + 1][1]
			DP[i][j][1] %= mod
	print(DP[K - 1][1][1])
	return 0
solve()


(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
spl = int(N ** 0.5) + 1
l = list(range(spl)) + [N // i for i in reversed(range(1, spl))]
m = 2 * spl - 1
for i in reversed(range(m - 1)):
	l[i + 1] -= l[i]
dp = [l[:]] + [[0] * m for _ in range(K - 1)]
for i in range(K - 1):
	for j in range(m - 1):
		dp[i][j + 1] += dp[i][j]
		dp[i][j + 1] %= MOD
	for j in range(1, m):
		dp[i + 1][-j] = dp[i][j] * l[-j] % MOD
ans = 0
for v in dp[-1][1:]:
	ans += v
	ans %= MOD
print(ans)


def f(n, k):
	lim = int((n + 0.1) ** 0.5) + 1
	ws = []
	s = 0
	for i in range(1, lim):
		w = n // i - n // (i + 1)
		ws.append(w)
		s += w
	ws += [1] * (n - s)
	m = len(ws)
	dp0 = ws[::-1]
	dp1 = [0] * m
	for _ in range(k - 1):
		s = 0
		for j in range(m):
			s += dp0[j]
			dp1[m - j - 1] = s * ws[j] % md
		dp0 = dp1[:]
	print(sum(dp0) % md)
md = 10 ** 9 + 7
(n, k) = list(map(int, input().split()))
f(n, k)


(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
state = []
i = 1
while i <= N:
	if i * i <= N:
		state.append(1)
		i += 1
	else:
		j = N // i
		state.append(N // j - i + 1)
		i = N // j + 1
L = len(state)
dp = [[0] * L for _ in range(K + 1)]
dp[0][0] = 1
for k in range(K):
	cum_sum = [0] * (L + 1)
	for y in range(L):
		cum_sum[y + 1] = (cum_sum[y] + dp[k][y]) % MOD
	for x in range(L):
		dp[k + 1][x] += cum_sum[L - x]
		dp[k + 1][x] *= state[x]
		dp[k + 1][x] %= MOD
print(sum(dp[K]) % MOD)


from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10 ** 5)
stdin = sys.stdin
sqrt = math.sqrt
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right

def LI():
	return list(map(int, stdin.readline().split()))

def LF():
	return list(map(float, stdin.readline().split()))

def LI_():
	return list(map(lambda x: int(x) - 1, stdin.readline().split()))

def II():
	return int(stdin.readline())

def IF():
	return float(stdin.readline())

def LS():
	return list(map(list, stdin.readline().split()))

def S():
	return list(stdin.readline().rstrip())

def IR(n):
	return [II() for _ in range(n)]

def LIR(n):
	return [LI() for _ in range(n)]

def FR(n):
	return [IF() for _ in range(n)]

def LFR(n):
	return [LI() for _ in range(n)]

def LIR_(n):
	return [LI_() for _ in range(n)]

def SR(n):
	return [S() for _ in range(n)]

def LSR(n):
	return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

def A():
	s = S()
	b = list(set(s))
	a = len(list(set(s)))
	if a == 2 and s.count(b[0]) == s.count(b[1]) == 2:
		print('Yes')
	else:
		print('No')
	return

def B():
	n = II()
	p = LI()
	ans = 0
	for i in range(1, n - 1):
		if p[i - 1] < p[i] and p[i] < p[i + 1] or (p[i + 1] < p[i] and p[i] < p[i - 1]):
			ans += 1
	print(ans)
	return

def C():
	n = II()
	d = LI()
	d.sort()
	ans = 0
	for i in range(10 ** 5 + 1):
		if n // 2 == bisect_left(d, i):
			ans += 1
	print(ans)
	return

def combination_mod(n, k, mod):
	from math import factorial
	if n < 0 or k < 0 or n < k:
		return 0
	if n == 0 or k == 0:
		return 1
	a = factorial(n) % mod
	b = factorial(k) % mod
	c = factorial(n - k) % mod
	return a * power_func(b, mod - 2, mod) * power_func(c, mod - 2, mod) % mod

def power_func(a, b, mod):
	if b == 0:
		return 1
	if b % 2 == 0:
		d = power_func(a, b // 2, mod)
		return d * d % mod
	if b % 2 == 1:
		return a * power_func(a, b - 1, mod) % mod

def D():
	(n, k) = LI()
	ans = 0
	for i in range(1, k + 1):
		a = combination_mod(n - k + 1, i, mod)
		b = combination_mod(k - 1, i - 1, mod)
		print(a * b % mod)
	return

def dijkstra(num, start, edge, g):
	dist = defaultdict(lambda : inf)
	dist[start, 0] = 0
	q = [(dist[start, 0], start, 0)]
	while q:
		(du, u, t) = heappop(q)
		for j in edge[u]:
			if t == 2:
				t = -1
			if dist[j, t + 1] > du + 1:
				dist[j, t + 1] = du + 1
				heappush(q, [dist[j, t + 1], j, t + 1])
	return dist

def E():
	(n, m) = LI()
	v = LIR_(m)
	(s, t) = LI_()
	edge = defaultdict(list)
	for (x, y) in v:
		edge[x].append(y)
	d = dijkstra(n, s, edge, t)
	if d[t, 0] == inf:
		print(-1)
	else:
		print(d[t, 0] // 3)
	return

def F():
	(n, k) = LI()
	f = defaultdict(int)
	Range = int(sqrt(n))
	dp = [0] * (2 * Range)
	m = 0
	l = 0
	for i in range(Range, 0, -1):
		dp[i - 1] = 1
		f[i - 1] = 1
		if n // i == i:
			l = 1
			continue
		dp[Range + m] = n // i - n // (i + 1)
		f[Range + m] = n // i - n // (i + 1)
		m += 1
	R = 2 * Range - l
	for _ in range(k - 1):
		ndp = [0] * (2 * Range)
		for j in range(R):
			ndp[R - j - 1] = dp[j]
		ndp = list(itertools.accumulate(ndp[::-1]))[::-1]
		dp = [d * f[num] % mod for (num, d) in enumerate(ndp)]
	ans = sum(dp) % mod
	print(ans)
	return
F()


(n, k) = map(int, input().split())
MOD = 10 ** 9 + 7
dist = [(n + 1, n + 1)]
r = n + 1
for i in range(2, n + 100):
	r = dist[-1][0]
	l = n // i + 1
	if r - l < 1:
		break
	dist.append((l, r))
while True:
	if r == 1:
		break
	dist.append((r - 1, r))
	r -= 1
dist = dist[::-1]
del dist[-1]
length = [r - l for (l, r) in dist]
dp = [[0] * len(dist) for i in range(k)]
for i in range(len(dist)):
	dp[0][i] = length[i]
for i in range(k - 1):
	ru = 0
	for j in range(len(dist)):
		ru += dp[i][j]
		ru %= MOD
		dp[i + 1][~j] += ru * length[~j]
		dp[i + 1][~j] %= MOD
print(sum(dp[-1]) % MOD)


from numpy import int_
mod = 10 ** 9 + 7
(N, K) = map(int, input().split())
M = int(N ** 0.5)
T = [N // i - N // (i + 1) for i in range(1, M + 1)]
dp = int_([1] * (N - sum(T)) + T[::-1])
A = dp[:]
for _ in range(K - 1):
	dp = A * dp.cumsum()[::-1] % mod
print(sum(dp) % mod)


from itertools import accumulate
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
sqrt = int(N ** (1 / 2))
count = [N // i - N // (i + 1) for i in range(1, N // sqrt)] + [1] * sqrt
ansList = count
for _ in range(K):
	ansList = [i * j % mod for (i, j) in zip(accumulate(reversed(ansList)), count)]
print(ansList[-1])


(n, k) = map(int, input().split())
a = int(n ** 0.5)
mod = 10 ** 9 + 7
l = [0] * (a + 1)
for i in range(a, 0, -1):
	l[i] = i
	l.append(n // i)
for i in range(1, 2 * a + 1):
	l[-i] = l[-i] - l[-i - 1]
dp = [l] + [[0] * (2 * a + 1) for i in range(k - 1)]
for i in range(1, k):
	t = 0
	for j in range(1, 2 * a + 1):
		t += dp[i - 1][j]
		t %= mod
		dp[i][-j] = t * l[-j] % mod
ans = 0
for i in dp[-1][1:]:
	ans += i
	ans %= mod
print(ans)


from collections import *
import sys
try:
	fin = open('in')
except:
	fin = sys.stdin
input = lambda : fin.readline().strip()
mod = 10 ** 9 + 7
(n, k) = map(int, input().split())
nparts = []
i = 1
while i <= n:
	j = n // (n // i)
	nparts.append(j - i + 1)
	i = j + 1
row = nparts
for r in range(1, k):
	tmp = []
	s = 0
	for i in range(len(nparts) - 1, -1, -1):
		s += row[-(i + 1)]
		tmp.append(s * nparts[i] % mod)
	tmp.reverse()
	row = tmp
print(sum(row) % mod)


(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
n = 1
A = []
while True:
	A.append(N // n)
	if N // (n + 1) < n + 1:
		break
	n += 1
A.append(n)
L = 2 * n
dp = [[0] * L for _ in range(K)]
for l in range(n):
	dp[0][l] = 1
i = 0
for l in reversed(range(n, L)):
	dp[0][l] = A[i] - A[i + 1]
	i += 1
for k in range(1, K):
	s = 0
	for l in reversed(range(L)):
		s = (s + dp[k - 1][L - l - 1]) % mod
		dp[k][l] = s * dp[0][l] % mod
ans = 0
for l in range(L):
	ans = (ans + dp[K - 1][l]) % mod
print(ans)


mod = 10 ** 9 + 7
(N, K) = map(int, input().split())
M = int(N ** 0.5)
dp = [[0] * M for _ in range(K + 1)]
dp1 = [[0] * M for _ in range(K + 1)]
dp2 = [[0] * M for _ in range(K + 1)]
dp[0][0] = 1
dp1[0][0] = 1
dp2[0][0] = N
for m in range(1, M):
	dp[0][m] = 1
	dp1[0][m] = dp1[0][m - 1] + dp[0][m]
	dp2[0][m] += dp2[0][m - 1] + N // (m + 1) * dp[0][m]
dp[1][0] = N
dp1[1][0] = N
dp2[1][0] = N ** 2
for m in range(1, M):
	dp[1][m] = N // (m + 1)
	dp1[1][m] = dp1[1][m - 1] + dp[1][m]
	dp2[1][m] += dp2[1][m - 1] + N // (m + 1) * dp[1][m]
for k in range(1, K):
	for m in range(M):
		dp[k + 1][m] = dp1[k][M - 1] + N // (m + 1) * dp1[k - 1][m] + dp2[k - 1][M - 1] - dp2[k - 1][m] - M * dp1[k - 1][M - 1]
		dp[k + 1][m] %= mod
		dp1[k + 1][m] = dp1[k + 1][m - 1] + dp[k + 1][m]
		dp1[k + 1][m] %= mod
		dp2[k + 1][m] = dp2[k + 1][m - 1] + N // (m + 1) * dp[k + 1][m]
		dp2[k + 1][m] %= mod
print(dp[K][0])


from math import sqrt
from itertools import accumulate

def inpl():
	return list(map(int, input().split()))
MOD = 10 ** 9 + 7
(N, K) = inpl()
p = 0
X = []
for i in range(1, int(sqrt(N)) + 1):
	X.append(N // i)
A = [1] * len(X)
B = [X[-2 - i] - X[-1 - i] for i in range(len(X) - 1)]
if sum(A) + sum(B) < N:
	C = A + [N - sum(A) - sum(B)] + B
else:
	C = A + B
DP = [c % MOD for c in C]
for _ in range(K - 1):
	DP2 = [0] * len(C)
	S = [0] * len(C)
	S[0] = DP[0] * 1
	for i in range(1, len(C)):
		S[i] = (S[i - 1] + DP[i]) % MOD
	for i in range(len(C)):
		DP2[i] = S[-1 - i] * C[i] % MOD
	DP = DP2
print(sum(DP) % MOD)


import sys
from math import sqrt
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7
(N, K) = MAP()
M = int(sqrt(N))
i = 1
x = N
li1 = []
li2 = []
mul = []
while i < x:
	li1.append(x)
	i += 1
	prev = x
	x = N // i
	li2.append((prev - x) * (i - 1))
	mul.append(prev - x)
li = []
if i == x:
	li += li1 + [x] + li2[::-1]
else:
	li += li1 + li2[::-1]
M = len(li)
mul = [1] * (M - len(li2)) + mul[::-1]
dp = list2d(K - 1, M, 0)
for i in range(M):
	dp[0][i] = li[i]
for i in range(1, K - 1):
	acc = list(accumulate(dp[i - 1]))[::-1]
	for j in range(M):
		dp[i][j] = acc[j] * mul[j] % MOD
print(sum(dp[K - 2]) % MOD)


import sys
import numpy as np
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
MOD = 10 ** 9 + 7
(N, K) = lr()
M = int(N ** 0.5)
upper_cnt = np.zeros(M + 1, dtype=np.int64)
A = np.arange(M + 1, dtype=np.int64)
upper_cnt[1:] = N // A[1:] - np.maximum(M, N // (A[1:] + 1))
lower = np.zeros(M + 1, dtype=np.int64)
upper = np.zeros(M + 1, dtype=np.int64)
lower[1] = 1
for i in range(K):
	prev_lower = lower.copy()
	prev_upper = upper.copy()
	lower_cum = prev_lower.cumsum() % MOD
	upper_cum = prev_upper.cumsum() % MOD
	lower = np.zeros(M + 1, dtype=np.int64)
	lower[1:] += lower_cum[-1] + upper_cum[-1]
	lower[1:] -= upper_cum[:-1]
	upper = lower_cum * upper_cnt
	lower %= MOD
	upper %= MOD
answer = (lower[1:].sum() + upper[1:].sum()) % MOD
print(answer)


(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
r = int(pow(N, 1 / 2))
const = []
if N // r == r:
	s = r - 1
else:
	s = r
for i in range(1, r + 1):
	const.append(N // i - N // (i + 1))
const.reverse()
const = [1 for i in range(s)] + const
dp = [[]]
for c in const:
	try:
		dp[0].append(dp[0][-1] + c)
	except:
		dp[0].append(c)
dp += [[0 for i in range(len(const))] for k in range(K - 1)]
for k in range(1, K):
	for i in range(len(const)):
		dp[k][i] = (dp[k][i - 1] + dp[k - 1][len(const) - i - 1] % mod * const[i]) % mod
print(dp[-1][-1] % mod)


def main():
	(N, K) = map(int, input().split())
	DIV = 10 ** 9 + 7
	sqrtn = int(N ** 0.5)
	ans = 1
	s = []
	for i in range(1, sqrtn + 1):
		s.append(i)
		if i < N // i:
			s.append(N // i)
	s.sort()
	r = []
	for i in range(len(s) - 1):
		left = N // s[i + 1]
		right = N // s[i]
		r.append(right - left)
	r.append(1)
	m = len(s)
	mp = {}
	for i in range(m):
		mp[s[i]] = i
	dp = [[0 for _ in range(m)] for _ in range(K + 1)]
	dp[0][mp[N]] = 1
	for i in range(K):
		for j in range(m - 2, -1, -1):
			dp[i][j] += dp[i][j + 1]
			dp[i][j] %= DIV
		for j in range(m):
			nj = mp[N // s[j]]
			dp[i + 1][j] += dp[i][nj] * r[j] % DIV
			dp[i + 1][j] %= DIV
	ans = 0
	for j in range(m):
		ans += dp[K][j]
		ans %= DIV
	print(ans)
main()


from math import sqrt
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
m = int(sqrt(N))
if N // (m + 1) == m:
	dp = [[[0 for i in range(0, 2)] for j in range(0, int(sqrt(N)))] for k in range(0, K + 1)]
	for i in range(0, int(sqrt(N))):
		dp[1][i][1] = 1
		dp[1][i][0] = N // (i + 1) - N // (i + 2)
	for k in range(2, K + 1):
		s = 0
		for i in range(0, int(sqrt(N))):
			s = (s + dp[k - 1][i][1]) % mod
			dp[k][i][0] = s * (N // (i + 1) - N // (i + 2)) % mod
		for j in range(0, int(sqrt(N))):
			i = int(sqrt(N)) - j - 1
			s = (s + dp[k - 1][i][0]) % mod
			dp[k][i][1] = s
	ans = sum((dp[K][i][0] + dp[k][i][1] for i in range(0, int(sqrt(N))))) % mod
	print(ans)
else:
	dp0 = [[0 for i in range(0, int(sqrt(N)) - 1)] for k in range(0, K + 1)]
	dp1 = [[0 for i in range(0, int(sqrt(N)))] for k in range(0, K + 1)]
	for i in range(0, int(sqrt(N)) - 1):
		dp0[1][i] = N // (i + 1) - N // (i + 2)
		dp1[1][i] = 1
	dp1[1][-1] = 1
	for k in range(2, K + 1):
		s = 0
		for i in range(0, int(sqrt(N)) - 1):
			s = (s + dp1[k - 1][i]) % mod
			dp0[k][i] = s * (N // (i + 1) - N // (i + 2)) % mod
		s = (s + dp1[k - 1][int(sqrt(N)) - 1]) % mod
		dp1[k][int(sqrt(N)) - 1] = s % mod
		for j in range(1, int(sqrt(N))):
			i = int(sqrt(N)) - j - 1
			s = (s + dp0[k - 1][i]) % mod
			dp1[k][i] = s
	ans = sum((dp0[K][i] + dp1[K][i] for i in range(0, int(sqrt(N)) - 1))) % mod
	ans = (ans + dp1[K][-1]) % mod
	print(ans)


import math
import os
import sys
from collections import defaultdict
if os.getenv('LOCAL'):
	sys.stdin = open('_in.txt', 'r')
sys.setrecursionlimit(2147483647)
INF = float('inf')
IINF = 10 ** 18
MOD = 10 ** 9 + 7
(N, K) = list(map(int, sys.stdin.readline().split()))
NM = []
prev = 0
for i in range(1, int(math.sqrt(N)) + 2):
	m = int(N // i)
	NM.append(N - m - prev)
	prev = N - m
cnt = N
nums = []
while cnt >= 1:
	nums.append(cnt)
	i = int(N // cnt)
	p = NM[i] if i < len(NM) else 1
	cnt -= p
nums.reverse()
dp = defaultdict(lambda : defaultdict(int))
for n in nums:
	dp[1][n] = n
for k in range(2, K + 1):
	for n in nums:
		i = int(N // n)
		p = NM[i] if i < len(NM) else 1
		ret = dp[k - 1][i] * p % MOD
		cum = dp[k][n - p]
		dp[k][n] = (cum + ret) % MOD
ans = dp[K][N]
print(ans % MOD)


import sys
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
	from math import gcd
except Exception:
	from fractions import gcd
MOD = 1000000007

def solve(N: int, K: int):
	ns = []
	for i in range(1, N + 1):
		if N < i * i:
			break
		ns.append(i)
		ns.append(N // i)
	ns = sorted(list(set(ns)))
	m = {n: i for (i, n) in enumerate(ns)}
	l = [1] * len(ns)
	for (i, (s, b)) in enumerate(zip(ns, ns[1:])):
		l[i] = N // s - N // b
	dp = [[0] * len(ns) for _ in range(K + 1)]
	dp[0][m[N]] = 1
	for i in range(K):
		for j in range(len(ns) - 2, -1, -1):
			dp[i][j] += dp[i][j + 1]
		for (j, nn) in enumerate(ns):
			nj = m[N // nn]
			dp[i + 1][j] = (dp[i + 1][j] + dp[i][nj] * l[j]) % MOD
	return sum(dp[-1]) % MOD

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	N = int(next(tokens))
	K = int(next(tokens))
	result = solve(N, K)
	print(result)
main()


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict
con = 10 ** 9 + 7
INF = float('inf')

def getlist():
	return list(map(int, input().split()))

def main():
	(N, K) = getlist()
	preList = []
	preList2 = []
	for i in range(1, N + 1):
		if i ** 2 == N:
			preList.append(1)
			break
		elif i ** 2 > N:
			break
		elif i == int(N // i):
			preList.append(1)
			break
		else:
			preList.append(int(N // i) - int(N // (i + 1)))
			preList2.append(1)
	start = list(reversed(preList + preList2))
	M = len(start)
	DP = [[0] * M for i in range(K)]
	DP[0] = start
	for i in range(1, K):
		Csum = [0] * (M + 1)
		for j in range(M):
			Csum[j + 1] += Csum[j] + DP[i - 1][j]
		for j in range(M):
			DP[i][j] = Csum[M - j] * DP[0][j]
			DP[i][j] %= con
	print(sum(DP[K - 1]) % con)
main()


MOD = 10 ** 9 + 7
from math import sqrt, floor
(n, k) = [int(i) for i in input().split()]
sn = floor(sqrt(n)) + 1
pre = [0] * sn
pre[1] = 1
cur = [1] * sn
cur[0] = 0
for _ in range(k - 1):
	new = [sum(cur) % MOD] * sn
	new[0] = 0
	s = sum(pre) % MOD
	b = 0
	res = 0
	for j in range(sn - 1, 0, -1):
		a = n // j - (sn - 1)
		res += (a - b) * s
		res %= MOD
		new[j] += res
		if new[j] > MOD:
			new[j] -= MOD
		s -= pre[j]
		b = a
	(pre, cur) = (cur, new)
ans = 0
for j in range(sn - 1, 0, -1):
	ans += pre[j] * (n // j - (sn - 1))
	ans %= MOD
print((sum(cur) + ans) % MOD)


import sys
input = sys.stdin.readline

def I():
	return int(input())

def MI():
	return map(int, input().split())

def LI():
	return list(map(int, input().split()))

def main():
	mod = 10 ** 9 + 7
	(N, K) = MI()
	M = int(N ** 0.5)
	cnt = []
	i = 1
	while i <= N:
		if i <= M:
			cnt.append(1)
			i += 1
		else:
			temp = int(N / i)
			cnt.append(int(N / temp - i + 1))
			i = int(N / temp + 1)
	N2 = len(cnt)
	dp = [[0] * N2 for _ in range(K)]
	for j in range(N2):
		dp[0][j] = cnt[j]
	for i in range(K - 1):
		S = [0] * (N2 + 1)
		for j in range(N2):
			S[j + 1] = (S[j] + dp[i][j]) % mod
		for j in range(N2):
			dp[i + 1][j] = S[N2 - j] * cnt[j] % mod
	ans = 0
	for j in range(N2):
		ans = (ans + dp[-1][j]) % mod
	print(ans)
main()


import sys
input = sys.stdin.readline
from itertools import accumulate
MOD = 10 ** 9 + 7

def main():
	(n, k) = map(int, input().split())
	S = set()
	i = 1
	while i * i <= n:
		S.add(i)
		S.add(n // i)
		i += 1
	L = [0] + sorted(S)
	l = len(L) - 1
	num = [0] * l
	for i in range(l):
		num[i] = L[i + 1] - L[i]
	dp = [0] * l
	dp[0] = 1
	for _ in range(k):
		A = list(accumulate(dp))
		for i in range(l):
			dp[i] = A[l - 1 - i] * num[i]
			dp[i] %= MOD
	ans = sum(dp) % MOD
	print(ans)

def __starting_point():
	main()
__starting_point()


import sys
sys.setrecursionlimit(2147483647)
INF = float('inf')
MOD = 10 ** 9 + 7
input = lambda : sys.stdin.readline().rstrip()

def resolve():
	(n, k) = map(int, input().split())
	s = set()
	for i in range(1, 1 + int(n ** 0.5)):
		s.add(i)
		s.add(n // i)
	A = sorted(s)
	m = len(A)
	coef = [0] * m
	coef[0] = 1
	for i in range(1, m):
		coef[i] = A[i] - A[i - 1]
	dp = [0] * m
	dp[0] = 1
	for i in range(k):
		for j in range(m - 1):
			dp[j + 1] += dp[j]
			dp[j + 1] %= MOD
		ndp = [0] * m
		for j in range(m):
			ndp[j] = dp[m - j - 1] * coef[j]
			ndp[j] %= MOD
		dp = ndp
	print(sum(dp) % MOD)
resolve()


(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
num = []
now = N + 1
i = 1
while True:
	r = N // (i + 1) + 1
	if r == now:
		break
	num.append(now - r)
	now = r
	i += 1
num += [1] * (N - sum(num))
n = len(num)
dp = [[0] * n for i in range(K)]
for _n in range(n):
	dp[0][_n] = num[_n]
for i in range(1, K):
	s = 0
	for _n in range(n):
		j = n - 1 - _n
		s += dp[i - 1][j] % MOD
		s %= MOD
		dp[i][_n] = s * num[_n] % MOD
ans = sum(dp[-1])
print(ans % MOD)


from bisect import bisect_left
(n, k) = map(int, input().split())
if n == 1:
	exit(print(1))
d = [1]
t = [1]
for i in range(2, int(n ** 0.5) + 2):
	if n // d[-1] != n // i:
		d.append(i)
		t.append(1)
	else:
		t[-1] += 1
dd = []
for i in range(d[-1], 0, -1):
	if n // i <= d[-1]:
		continue
	dd.append(n // i)
x = d + dd
for i in range(len(t), len(x)):
	t.append(x[i] - x[i - 1])
di = [0] * len(x)
mod = 10 ** 9 + 7
for i in range(len(x)):
	di[i] = bisect_left(x, n // x[i])
n = len(x)
dp = [n * [0] for _ in range(k)]
dp[0] = t[:]
for i in range(1, k):
	for j in range(1, n):
		dp[i - 1][j] += dp[i - 1][j - 1]
		dp[i - 1][j] %= mod
	for j in range(n):
		dp[i][j] = dp[i - 1][di[j]] * t[j] % mod
print(sum(dp[-1]) % mod)


import sys

def MI():
	return map(int, sys.stdin.readline().rstrip().split())
(N, K) = MI()
mod = 10 ** 9 + 7
B = [i for i in range(int(N ** 0.5) + 1)]
C = [N // i for i in range(1, int(N ** 0.5) + 1)]
C.reverse()
if B[-1] == C[0]:
	del C[0]
D = B + C
A = [D[i + 1] - D[i] for i in range(len(D) - 1)]
a = len(A)
dp = [[0] * a for _ in range(K)]
for i in range(K):
	if i == 0:
		for j in range(a):
			if j == 0:
				dp[i][j] = A[j]
			else:
				dp[i][j] = dp[i][j - 1] + A[j]
				dp[i][j] %= mod
	else:
		for j in range(a):
			if j == 0:
				dp[i][j] = dp[i - 1][a - j - 1]
			else:
				dp[i][j] = dp[i][j - 1] + dp[i - 1][a - j - 1] * A[j]
				dp[i][j] %= mod
print(dp[-1][-1])


from itertools import accumulate
(N, K) = map(int, input().split())
N_s = int(N ** 0.5)
list_a = [1] * N_s
list_b = [N // j - N_s for j in range(1, N_s + 1)]
list_p = [N // j - N_s for j in range(1, N_s + 1)]
for p in range(1, len(list_p)):
	list_p[p - 1] = list_p[p - 1] - list_p[p]
for p in range(1, len(list_b)):
	list_b[p - 1] = list_b[p - 1] - list_b[p]
list_bb = list(reversed(list(accumulate(reversed(list_b)))))
list_aa = list(accumulate(list_a))
mod = 10 ** 9 + 7
for i in range(K - 1):
	temp = sum(list_a)
	list_an = [(temp + list_bb[j]) % mod for j in range(N_s)]
	list_bn = [list_p[j - 1] * list_aa[j - 1] % mod for j in range(1, N_s + 1)]
	list_bbn = list(reversed(list(accumulate(reversed(list_bn)))))
	list_aa = list(accumulate(list_an))
	list_a = list_an
	list_b = list_bn
	list_bb = list_bbn
print((sum(list_a) + sum(list_b)) % mod)


from collections import deque
(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
JN = deque()
SQN = int(N ** 0.5)
JN.append(SQN)
if SQN ** 2 != N:
	JN.append(N // SQN)
for j in range(SQN - 1, 0, -1):
	JN.appendleft(j)
	JN.append(N // j)
JN.appendleft(0)
LJN = len(JN)
dp = [[0 for _ in range(LJN)] for _ in range(K)]
cdp = [[0 for _ in range(LJN)] for _ in range(K)]
w = [0 for _ in range(LJN)]
prv = 0
for i in range(1, LJN):
	jn = JN[i]
	dp[0][i] = 1
	w[i] = jn - prv
	cdp[0][i] = jn
	prv = JN[i]
for i in range(K - 1):
	for j in range(1, LJN):
		dp[i + 1][j] = cdp[i][LJN - j]
		dp[i + 1][j] %= MOD
		cdp[i + 1][j] = cdp[i + 1][j - 1] + dp[i + 1][j] * w[j]
		cdp[i + 1][j] %= MOD
print(cdp[-1][-1])


from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, groupby
import sys
import bisect
import string
import math
import time
import random

def S_():
	return input()

def LS():
	return [i for i in input().split()]

def I():
	return int(input())

def MI():
	return map(int, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def StoI():
	return [ord(i) - 97 for i in input()]

def ItoS(nn):
	return chr(nn + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def GI(V, E, Directed=False, index=0):
	org_inp = []
	g = [[] for i in range(n)]
	for i in range(E):
		inp = LI()
		org_inp.append(inp)
		if index == 0:
			inp[0] -= 1
			inp[1] -= 1
		if len(inp) == 2:
			(a, b) = inp
			g[a].append(b)
			if not Directed:
				g[b].append(a)
		elif len(inp) == 3:
			(a, b, c) = inp
			aa = (inp[0], inp[2])
			bb = (inp[1], inp[2])
			g[a].append(bb)
			if not Directed:
				g[b].append(aa)
	return (g, org_inp)

def bit_combination(k, n=2):
	rt = []
	for tb in range(n ** k):
		s = [tb // n ** bt % n for bt in range(k)]
		rt += [s]
	return rt

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
YN = ['Yes', 'No']
mo = 10 ** 9 + 7
inf = float('inf')
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10 ** 5)
input = lambda : sys.stdin.readline().rstrip()

def ran_input():
	import random
	n = random.randint(4, 16)
	(rmin, rmax) = (1, 10)
	a = [random.randint(rmin, rmax) for _ in range(n)]
	return (n, a)
show_flg = False
show_flg = True
ans = 0
(n, k) = LI()
b = []
for i in range(1, int(n ** 0.5) + 1):
	b += [n // i]
	b += [n // (n // i)]
b = sorted(set(b))
d = [i - j for (i, j) in zip(b, [0] + b)]
k += 1
m = len(b)
dp = [[0] * m for j in range(1 + k)]
dp[0][0] = 1
for i in range(k):
	sdp = [0]
	for j in range(m):
		sdp.append((sdp[-1] + dp[i][j] * d[j]) % mo)
	sdp = sdp[::-1]
	for j in range(m):
		dp[i + 1][j] = sdp[j]
print(sdp[0])


def main():
	MOD = 10 ** 9 + 7
	(n, k) = map(int, input().split())
	t = []
	t_cnt = []
	cnt = [0]
	for i in range(1, int(n ** 0.5) + 1):
		tmp = n // i
		if tmp not in t:
			t.append(tmp)
			t_cnt.append(1)
		else:
			cnt[-1] += tmp
			t_cnt[-1] += 1
	for tmp in range(t[-1] - 1, 0, -1):
		tmp_j = n // tmp - n // (tmp + 1)
		if tmp_j != 0:
			t.append(tmp)
			t_cnt.append(tmp_j)
	cnt = []
	now = 0
	for i in range(len(t)):
		now += t[i] * t_cnt[i]
		cnt.append(now)
	kind = len(cnt)
	dp = [cnt] + [[0] * kind for i in range(k - 2)]
	for i in range(1, k - 1):
		for j in range(kind):
			dp[i][j] = (dp[i - 1][kind - j - 1] * t_cnt[j] + dp[i][j - 1]) % MOD
	print(dp[-1][-1])
	return
main()


from itertools import accumulate as r
(n, k) = map(int, input().split())
m = 10 ** 9 + 7
j = int(n ** 0.5)
c = [n // (i + 1) - n // (i + 2) for i in range(n // (j + 1))] + [1] * j
x = c
exec('x=[(y*d)%m for y,d in zip(r(x[::-1]),c)];' * k)
print(x[-1])


import numpy as np
(n, k) = list(map(int, input().split()))
mod = 10 ** 9 + 7
mx = 1
while (mx + 1) ** 2 <= n:
	mx += 1
dp_u = np.ones(mx, np.int64)
N = np.full(mx, n, np.int64)
L = N // np.arange(1, mx + 1)
R = np.maximum(N // np.arange(2, mx + 2), mx)
coef = L - R
dp_d = coef
for _ in range(2, k + 1):
	acc_u = np.cumsum(dp_u) % mod
	acc_d = np.cumsum(dp_d[::-1]) % mod
	dp_u = (dp_u.sum() + acc_d[::-1]) % mod
	dp_d = coef * acc_u % mod
ans = (dp_u.sum() + dp_d.sum()) % mod
print(ans)


(N, K) = (int(i) for i in input().split())
N += 1
l1 = []
l2 = []
n_ma = 0
for i in range(1, N):
	j = (N - 1) // (i + 1) + 1
	if i > j:
		break
	elif i == j:
		l1.append(i)
		break
	l1.append(i)
	l2.append(j)
l2.reverse()
L = l1 + l2 + [N]
M = len(L) - 1
DP = [[0] * (M + 1) for counter1 in range(K + 1)]

def BIT_query(BIT, idx):
	res_sum = 0
	while idx > 0:
		res_sum += BIT[idx]
		idx -= idx & -idx
	return res_sum

def BIT_update(BIT, idx, x):
	while idx <= M:
		BIT[idx] += x
		idx += idx & -idx
	return

def BIT_debug(BIT):
	return [BIT_query(BIT, i) - BIT_query(BIT, i - 1) for i in range(1, M + 1)]
MOD = 10 ** 9 + 7
for i in range(M):
	BIT_update(DP[1], i + 1, L[i + 1] - L[i])
for i in range(1, K):
	for j in range(M):
		x = BIT_query(DP[i], M - j)
		x *= L[j + 1] - L[j]
		x %= MOD
		BIT_update(DP[i + 1], j + 1, x)
print(BIT_query(DP[K], M) % MOD)


def f_small_products(N, K, MOD=10 ** 9 + 7):
	sqrt_n = int(N ** 0.5)
	num = [0 for i in range(2 * sqrt_n + 1)]
	for i in range(1, sqrt_n + 1):
		num[i] = 1
	for i in range(1, sqrt_n + 1):
		lo = max(sqrt_n + 1, (N + i + 1) // (i + 1))
		hi = N // i
		num[2 * sqrt_n + 1 - i] = hi - lo + 1
	dp = [[0 for j in range(2 * sqrt_n + 2)] for i in range(K + 1)]
	dp[0][1] = 1
	for i in range(K):
		for j in range(1, 2 * sqrt_n + 1):
			ways = dp[i][j] * num[j] % MOD
			dp[i + 1][1] += ways
			dp[i + 1][2 * sqrt_n + 2 - j] -= ways
		for j in range(1, 2 * sqrt_n + 1):
			dp[i + 1][j] += dp[i + 1][j - 1]
	return sum((a * b for (a, b) in zip(dp[K], num))) % MOD
(N, K) = [int(i) for i in input().split()]
print(f_small_products(N, K))


from itertools import accumulate

def f(n, k):
	lim = int((n + 0.1) ** 0.5) + 1
	ws = []
	s = 0
	for i in range(1, lim):
		w = n // i - n // (i + 1)
		ws.append(w)
		s += w
	ws += [1] * (n - s)
	dp = ws
	m = len(ws)
	for _ in range(k - 1):
		dp = [s * w % md for (s, w) in zip(accumulate(dp[::-1]), ws)]
	print(sum(dp) % md)
md = 10 ** 9 + 7
(n, k) = list(map(int, input().split()))
f(n, k)


(n, k) = map(int, input().split())
mod = 10 ** 9 + 7
s = set()
for i in range(1, int(n ** 0.5) + 1):
	s.add(i)
	s.add(n // i)
l = sorted(list(s))
d = {}
x = len(l)
for i in range(x - 1):
	le = n // l[i + 1]
	ri = n // l[i]
	d[l[i]] = [ri - le, i]
d[l[-1]] = [1, x - 1]
dp = [[0] * x for i in range(k + 1)]
dp[0][0] = 1
for i in range(k):
	for j in range(x - 1):
		dp[i][j + 1] += dp[i][j]
		dp[i][j + 1] %= mod
	for j in range(x):
		(s, nj) = d[n // l[j]]
		dp[i + 1][j] += dp[i][nj] * s
		dp[i + 1][j] %= mod
print(sum(dp[-1]) % mod)


(N, K) = map(int, input().split())
L = 10 ** 9 + 7
parts = []
i = 1
while i <= N:
	a = N // i
	j = N // a
	parts.append(j - i + 1)
	i = j + 1
C = parts
for _ in range(K - 1):
	C_new = []
	c = 0
	for (i, p) in enumerate(parts[::-1]):
		num_dual = i
		c += C[i]
		C_new.append(p * c % L)
	C = C_new[::-1]
print(sum(C) % L)


(N, K) = map(int, input().split(' '))
LIM = int(N ** 0.5) * 2 + 1
dp = [[0] * LIM for i in range(K - 1)]
ts = set()
tsl = []
tsr = []
num = {}
for i in range(1, int(N ** 0.5) + 1):
	x = N // i
	y = N // (N // i)
	if not tsl or tsl[-1] > x:
		tsl.append(x)
	if x != y and (not tsr or tsr[-1] < y):
		tsr.append(y)
	if x not in num:
		num[x] = 0
	if y not in num:
		num[y] = 0
ts = tsl + tsr[::-1]
idx = {k: i for (i, k) in enumerate(ts)}
for (j, t) in enumerate(ts):
	num[t] = N // t - N // ts[j - 1] if j > 0 else 1
	dp[0][idx[t]] = num[t] * t
MOD = 1000000007
for i in range(1, K - 1):
	pref = 0
	for j in reversed(range(len(ts))):
		R = len(ts) - j - 1
		pref += dp[i - 1][R]
		dp[i][j] = pref * num[ts[j]] % MOD
ans = sum(dp[-1])
print(ans % 1000000007)


from itertools import accumulate

def BC132_F():
	(n, k) = list(map(int, input().split(' ')))
	mod = 10 ** 9 + 7
	sqt = int(n ** 0.5)
	cnt = [n // i - n // (i + 1) for i in range(1, n // sqt)] + [1] * sqt
	x = cnt
	for _ in range(k):
		x = [i * j % mod for (i, j) in zip(accumulate(reversed(x)), cnt)]
	return x[-1]
print(BC132_F())


import math
from itertools import chain
(N, K) = map(int, input().split())
modulo = 10 ** 9 + 7
sqrtN = int(math.sqrt(N))
P = [N // d for d in range(1, sqrtN + 1)]
M = {i: 1 for i in chain(P, range(1, P[-1]))}
for k in range(2, K + 2):
	M2 = {}
	M2[N] = M[1]
	for (m, i) in zip(P, P[1:]):
		M2[i] = M2[m] + sum((M[j] for j in range(N // m + 1, N // i + 1)))
		M2[i] %= modulo
	for i in range(P[-1] - 1, 0, -1):
		M2[i] = M2[i + 1] + M[N // i] * (N // i - N // (i + 1))
		M2[i] %= modulo
	M = M2
print(M[1])


def hersCode(l, r, n, N):
	ok = l
	ng = r + 1
	while abs(ok - ng) > 1:
		mid = abs(ok + ng) // 2
		if mid * n <= N:
			ok = mid
		else:
			ng = mid
	return ng
(N, K) = list(map(int, input().split()))
MOD = 10 ** 9 + 7
if N == 1:
	print(1)
	exit()
L = []
t = 1
n = N
while t <= N:
	L.append(t)
	t = hersCode(t, N, N // t, N)
D = [0] * len(L)
L.append(N + 1)
for i in range(len(L) - 1):
	D[i] = (L[i + 1] - L[i]) % MOD
DP = [[0] * len(D) for _ in range(K)]
for i in range(len(D)):
	DP[0][i] = D[i]
for i in range(1, K):
	S = [0] * len(D)
	S[0] = DP[i - 1][0]
	for j in range(1, len(D)):
		S[j] = S[j - 1] + DP[i - 1][j]
	for j in range(len(D)):
		DP[i][j] = S[-1 - j] * D[j] % MOD
print(sum(DP[K - 1]) % MOD)


from itertools import accumulate as ac
(N, K) = map(int, input().split())
n = int(N ** 0.5)
mod = 10 ** 9 + 7
list_a = [1] * n
list_b = [N // j - N // (j + 1) for j in range(1, n)] + [N // n - n]
list_p = [p for p in list_b]
list_aa = list(ac(list_a))
list_bb = list(reversed(list(ac(reversed(list_b)))))
for i in range(K - 1):
	temp = sum(list_a)
	list_a = [(temp + list_bb[j]) % mod for j in range(n)]
	list_b = [list_p[j] * list_aa[j] % mod for j in range(n)]
	list_aa = list(ac(list_a))
	list_bb = list(reversed(list(ac(reversed(list_b)))))
print(sum(list_a + list_b) % mod)


import sys
input = sys.stdin.readline
import numpy as np
MOD = 10 ** 9 + 7
(n, k) = map(int, input().split())
S = set()
i = 1
while i * i <= n:
	S.add(i)
	S.add(n // i)
	i += 1
L = np.array([0] + sorted(S), dtype=np.int64)
l = len(L) - 1
num = np.diff(L)
dp = np.zeros(l, dtype=np.int64)
dp[0] = 1
for _ in range(k):
	A = np.cumsum(dp)
	dp = A[::-1] * num
	dp %= MOD
ans = dp.sum() % MOD
print(ans)


def main():
	(N, K) = map(int, input().split())
	MOD = 10 ** 9 + 7
	r = int(N ** 0.5 + 1)
	z = [i for i in range(r)] + [N // i for i in range(1, r)][::-1]
	m = len(z)
	pre = [0] + [1] * (m - 1)
	for _ in range(1, K + 1):
		dp = [0] * m
		for i in range(1, m):
			dp[i] = (dp[i - 1] + pre[m - i] * (z[i] - z[i - 1])) % MOD
		pre = dp
	print(dp[-1])
main()


import math
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
ans_array = []
divide_max = N
divide_count = []
for i in range(2, math.floor(math.sqrt(N)) + 2):
	divide = math.floor(N / i)
	ans_array.append(divide_max - divide)
	divide_count.append(divide_max - divide)
	divide_max = divide
for i in range(divide):
	ans_array.append(1)
ans_array = ans_array[::-1]
ans_length = len(ans_array)
ans_acc = [0] * ans_length
for k in range(2, K + 1):
	ans_acc[0] = ans_array[0]
	for i in range(1, ans_length):
		ans_acc[i] = (ans_acc[i - 1] + ans_array[i]) % mod
	for i in range(divide):
		ans_array[i] = ans_acc[ans_length - i - 1]
	for i in range(divide, ans_length):
		ans_array[i] = ans_acc[ans_length - i - 1] * divide_count[ans_length - 1 - i] % mod
ans_acc[0] = ans_array[0]
for i in range(1, ans_length):
	ans_acc[i] = (ans_acc[i - 1] + ans_array[i]) % mod
print(ans_acc[-1])


(N, K) = map(int, input().split())
s = set()
i = 1
while i * i <= N:
	s.add(i)
	s.add(N // i)
	i += 1
l = list(s)
l.sort()
nums = []
for i in range(len(l) - 1):
	le = N // l[i + 1]
	ri = N // l[i]
	nums.append(ri - le)
nums.append(1)
nums.reverse()
M = len(nums)
dp = [[0] * M for _ in range(K + 1)]
dp[0][0] = 1
MOD = 10 ** 9 + 7
for i in range(K):
	acc = [0]
	for j in range(M):
		acc.append((acc[-1] + dp[i][j]) % MOD)
	for j in range(M):
		dp[i + 1][j] = nums[j] * acc[M - j]
print(sum(dp[K]) % MOD)


(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
m = 1
(a, b) = ([], [])
while m * m <= N:
	a.append(m)
	b.append(N // m)
	m += 1
if a[-1] == b[-1]:
	b.pop()
a += b[::-1]
w = [b - a for (a, b) in zip([0] + a, a)]
L = len(a)
dp = [1] * L
for _ in range(K - 1):
	dp2 = [0] * L
	c = 0
	for (i, v) in enumerate(w):
		c += dp[i] * v
		dp2[L - 1 - i] += c
		dp2[L - 1 - i] %= MOD
	dp = dp2
ans = sum((a * b for (a, b) in zip(w, dp)))
print(ans % MOD)


(n, k) = map(int, input().split())
mod = 1000000007
a = []
i = 1
while i * i <= n:
	a.append(i)
	a.append(n // i)
	i += 1
m = len(a)
a.append(0)
a.sort()
dp = [0] * m
dp[0] = 1
acc = [0] * m
for _ in range(k):
	acc[0] = dp[0]
	for j in range(1, m):
		acc[j] = (acc[j - 1] + dp[j]) % mod
	for j in range(m):
		dp[j] = acc[m - j - 1] * (a[j + 1] - a[j]) % mod
ans = 0
for x in dp:
	ans = (ans + x) % mod
print(ans)


def examA():
	N = DI() / dec(7)
	ans = N
	print(N)
	return

def examB():
	ans = 0
	print(ans)
	return

def examC():
	ans = 0
	print(ans)
	return

def examD():
	ans = 0
	print(ans)
	return

def examE():
	ans = 0
	print(ans)
	return

def examF():
	(N, K) = LI()
	n = int(N ** 0.5)
	C = []
	L = [0] * (2 * int(n))
	for i in range(1, n + 1):
		now = N // i - N // (i + 1)
		C.append(now)
	for i in range(1, n + 1):
		if N // i == i:
			continue
		C.append(1)
	C.reverse()
	n = len(C)
	dp = [[0] * n for _ in range(K)]
	for i in range(n):
		dp[0][i] = C[i]
	for i in range(K - 1):
		S = 0
		for j in range(n):
			S += dp[i][j]
			S %= mod
			dp[i + 1][n - j - 1] = S * C[n - j - 1] % mod
	ans = 0
	for s in dp[-1]:
		ans += s
		ans %= mod
	print(ans)
	return
from decimal import getcontext, Decimal as dec
import sys, bisect, itertools, heapq, math, random
from copy import deepcopy
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def I():
	return int(input())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def DI():
	return dec(input())

def LDI():
	return list(map(dec, sys.stdin.readline().split()))

def LSI():
	return list(map(str, sys.stdin.readline().split()))

def LS():
	return sys.stdin.readline().split()

def SI():
	return sys.stdin.readline().strip()
global mod, mod2, inf, alphabet, _ep
mod = 10 ** 9 + 7
mod2 = 998244353
inf = 10 ** 18
_ep = dec('0.000000000001')
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}
getcontext().prec = 28
sys.setrecursionlimit(10 ** 7)
examF()


import sys
input = sys.stdin.readline
import math
mod = 10 ** 9 + 7
(N, K) = map(int, input().split())
K -= 1
P = set()
inv = {}
for i in range(1, int(math.sqrt(N) + 2)):
	if i ** 2 > N:
		break
	P.add(i)
	P.add(N // i)
	if i not in inv:
		inv[i] = N // i
	if N // i not in inv:
		inv[N // i] = i
P1 = sorted(list(P))
T = len(P1)
M = [1]
for i in range(T - 1):
	M.append(P1[i + 1] - P1[i])
co_to_ind = {}
for (i, p) in enumerate(P1):
	co_to_ind[p] = i
Inv = []
for p in P1:
	Inv.append(co_to_ind[inv[p]])
dp = [[0] * T for _ in range(K + 1)]
dp[0] = M
for i in range(K):
	tosum = [0] * T
	for ik in range(T):
		j = Inv[ik]
		tosum[j] = (tosum[j] + dp[i][ik]) % mod
	sumup = 0
	for ik in reversed(range(T)):
		sumup = (sumup + tosum[ik]) % mod
		dp[i + 1][ik] = sumup * M[ik] % mod
ans = 0
for t in range(T):
	ans = (ans + dp[K][t]) % mod
print(ans)


mod = 10 ** 9 + 7
(n, k) = map(int, input().split())
coef = []
for i in range(1, int(n ** 0.5) + 1):
	coef.append(n // i - n // (i + 1))
coef += [1] * (n - sum(coef))
coef = coef[::-1]
nn = len(coef)
dp = [[0] * nn for _ in range(k + 1)]
dp[0][0] = 1
for i in range(1, k + 1):
	tmp = 0
	for j in range(nn - 1, -1, -1):
		tmp += dp[i - 1][nn - 1 - j]
		tmp %= mod
		dp[i][j] = coef[j] * tmp
		dp[i][j] %= mod
print(sum(dp[k]) % mod)


(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
sq = 0
while (sq + 1) * (sq + 1) <= N:
	sq += 1
num = [0 for i in range(2 * sq + 1)]
for i in range(1, sq + 1):
	num[i] = 1
for i in range(1, sq + 1):
	lo = max(sq + 1, (N + i + 1) // (i + 1))
	hi = N // i
	num[2 * sq + 1 - i] = hi - lo + 1
dp = [[0 for j in range(2 * sq + 2)] for i in range(K + 1)]
dp[0][1] = 1
for i in range(K):
	for j in range(1, 2 * sq + 1):
		ways = dp[i][j] * num[j] % MOD
		dp[i + 1][1] += ways
		dp[i + 1][2 * sq + 2 - j] -= ways
	for j in range(1, 2 * sq + 1):
		dp[i + 1][j] += dp[i + 1][j - 1]
ans = 0
for j in range(1, 2 * sq + 1):
	ans += dp[K][j] * num[j]
print(ans % MOD)


import numpy as np
(N, K) = tuple(map(int, input().split()))
mod = 1000000007
m = N ** 0.5
cnt = [N // i - N // (i + 1) for i in range(1, int(m) + 1)]
cnt = np.array((cnt + [1 for _ in range(N - sum(cnt))])[::-1])
nxt = cnt[:]
for _ in range(K - 1):
	cnt = nxt * np.cumsum(cnt)[::-1] % mod
print(sum(cnt) % mod)


import sys

def input():
	return sys.stdin.readline().strip()
(N, K) = list(map(int, input().split()))
rootN = int(N ** 0.5)
num_list = [1] * rootN
now = rootN
for num in range(rootN, 0, -1):
	x = N // num
	num_list.append(x - now)
	now = x
dp = [[0] * len(num_list) for i in range(K)]
for i in range(len(num_list)):
	dp[0][i] = num_list[i]
mod = 10 ** 9 + 7
for k in range(1, K):
	sum_before = [dp[k - 1][0]]
	for i in range(1, len(num_list)):
		sum_before.append(sum_before[-1] + dp[k - 1][i])
	for i in range(len(num_list)):
		dp[k][i] = num_list[i] * sum_before[len(num_list) - 1 - i] % mod
print(sum(dp[-1]) % mod)


(n, k) = map(int, input().split())
(a, b) = ([], [])
i = 1
while i * i <= n:
	a.append(i)
	b.append(n // i)
	i += 1
if a[-1] == b[-1]:
	b.pop()
a += b[::-1]
import numpy as np
dp = np.array(a)
dp[1:] -= dp[:-1]
ini = np.copy(dp)
del a
del b
mod = 10 ** 9 + 7
for _ in range(k - 1):
	pre = np.cumsum(dp)
	dp = ini * pre[::-1]
	dp %= mod
print(sum(dp) % mod)


import math
MOD = 10 ** 9 + 7

def main():
	(N, K) = map(int, input().split())
	R = int(math.sqrt(N))
	if N // R == R:
		M = R * 2 - 1
	else:
		M = R * 2
	mapping = [0] * (M + 1)
	for i in range(1, R + 1):
		mapping[i] = i
		mapping[-i] = N // i
	cnt = [0] * (M + 1)
	for i in range(1, M + 1):
		cnt[i] = mapping[i] - mapping[i - 1]
	dp = [[0] * (M + 1) for _ in range(K + 1)]
	dp[0] = list(cnt)
	for i in range(M):
		dp[0][i + 1] += dp[0][i]
	for i in range(K - 1):
		for j in range(1, M + 1):
			if j <= R:
				idx = -j
			else:
				idx = M - j + 1
			dp[i + 1][j] = dp[i][idx]
		for j in range(M):
			dp[i + 1][j + 1] = (dp[i + 1][j] + dp[i + 1][j + 1] * cnt[j + 1]) % MOD
	print(dp[K - 1][M])
main()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	(n, k) = LI()
	l = []
	sq = int(n ** 0.5) + 1
	for i in range(1, sq + 1):
		l.append((i, n // i, 1))
	t = sq
	for (j, i, _) in l[::-1]:
		if t >= i:
			continue
		c = i - t
		l.append((i, j, c))
		t = i
	ll = len(l)
	dp = [[0] * ll for _ in range(k + 1)]
	dp[0][0] = 1
	l.append((inf, 0, 0))
	for i in range(k):
		dpi = dp[i]
		np = dp[i + 1]
		m = 0
		c = 0
		for j in range(ll - 1, -1, -1):
			t = l[j][1]
			tc = l[j][2]
			while l[m][0] <= t:
				c += dpi[m]
				c %= mod
				m += 1
			np[j] = c * tc % mod
	return sum(dp[-1]) % mod
print(main())


import sys
import math
stdin = sys.stdin
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
ns = lambda : stdin.readline().rstrip()
(n, k) = na()
mod = 1000000007
s = int(math.sqrt(n))
dp = [1] * (n // s + 1)
ep = [0] * s
dp[0] = 0
for i in range(1, s):
	ep[i] = 1
for z in range(k - 1):
	ndp = [0] * (n // s + 1)
	nep = [0] * s
	for i in range(1, n // s + 1):
		if i < s:
			nep[i] += dp[i]
		else:
			ndp[n // i] += dp[i]
	for i in range(1, s):
		ndp[i] += ep[i] * (n // i - n // (i + 1))
		ndp[i] %= mod
	for i in range(2, s):
		nep[i] += nep[i - 1]
		if nep[i] >= mod:
			nep[i] -= mod
	ndp[n // s] += nep[-1]
	ndp[n // s] %= mod
	for i in range(n // s - 1, 0, -1):
		ndp[i] += ndp[i + 1]
		if ndp[i] >= mod:
			ndp[i] -= mod
	(dp, ep) = (ndp, nep)
ans = sum(dp)
for i in range(1, s):
	ans += ep[i] * (n // i - n // (i + 1))
print(ans % mod)


import math
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
DBG = True and False

def ddprint(x):
	if DBG:
		print(x)
R = 10 ** 9 + 7
(n, k) = inm()
q = int(math.sqrt(n))
a = [[0] * (q + 1) for j in range(k)]
b = [[0] * (q + 1) for j in range(k)]
c = [0] * (q + 1)
c[1] = n - n // 2
for i in range(2, q):
	c[i] = n // i - n // (i + 1)
c[q] = n // q - q
for i in range(1, q + 1):
	a[0][i] = 1
	b[0][i] = c[i]
for j in range(1, k):
	aacc = [0] * (q + 2)
	bacc = [0] * (q + 2)
	for i in range(1, q + 1):
		aacc[i] = (aacc[i - 1] + a[j - 1][i]) % R
	for i in range(q, 0, -1):
		bacc[i] = (bacc[i + 1] + b[j - 1][i]) % R
	for i in range(1, q + 1):
		a[j][i] = (aacc[q] + bacc[i]) % R
		b[j][i] = aacc[i] * c[i] % R
print((sum(a[k - 1]) + sum(b[k - 1])) % R)


import sys
import numpy as np
sr = lambda : sys.stdin.readline().rstrip()
ir = lambda : int(sr())
lr = lambda : list(map(int, sr().split()))
MOD = 10 ** 9 + 7
(N, K) = lr()
M = int(N ** 0.5)
A = np.arange(M + 1, dtype=np.int64)
high_range = np.zeros(M + 1, dtype=np.int64)
high_range[1:] = N // A[1:] - np.maximum(M, N // (A[1:] + 1))
low = np.zeros(M + 1, dtype=np.int64)
high = np.zeros(M + 1, dtype=np.int64)
low[1] = 1
for _ in range(K):
	prev_low = low.copy()
	prev_high = high.copy()
	prev_low_cum = prev_low.cumsum() % MOD
	prev_high_cum = prev_high.cumsum() % MOD
	low = np.zeros(M + 1, dtype=np.int64)
	low[1:] += prev_low_cum[-1] + prev_high_cum[-1]
	low[1:] -= prev_high_cum[:-1]
	high = prev_low_cum * high_range
	low %= MOD
	high %= MOD
answer = (low[1:].sum() + high[1:].sum()) % MOD
print(answer % MOD)


def calc_floors(N):
	n_values = list()
	n_ranges = list()
	k = 1
	while k <= N:
		(left, right) = ((N + k + 1) // (k + 1), N // k)
		n_values.append(k)
		n_ranges.append((left, right))
		if left == 1:
			break
		k = N // (left - 1)
	return (n_values, n_ranges)

def main():
	MOD = 10 ** 9 + 7
	(N, K) = list(map(int, input().split()))
	(n_values, n_ranges) = calc_floors(N)
	dp = [[0 for _ in range(len(n_values))] for _ in range(K)]
	dp[0][0] = n_values[0]
	for i in range(1, len(n_values)):
		dp[0][i] = n_values[i] - n_values[i - 1]
	dp[0].reverse()
	for k in range(1, K):
		csdp = [0 for _ in range(len(n_values))]
		csdp[len(n_values) - 1] = dp[k - 1][len(n_values) - 1]
		for i in range(len(n_values) - 2, -1, -1):
			csdp[i] = csdp[i + 1] + dp[k - 1][i]
		for i in range(len(n_values)):
			v = csdp[len(n_values) - i - 1] * (n_ranges[i][1] - n_ranges[i][0] + 1)
			dp[k][i] = v % MOD
	ans = 0
	for i in range(len(n_values)):
		ans += dp[K - 1][i]
		ans %= MOD
	print(ans)
main()


import sys
sys.setrecursionlimit(10 ** 6)
(N, K) = map(int, input().split())
MOD = 10 ** 9 + 7
U = [0]
V = []
for x in range(1, int(N ** 0.5) + 1):
	U.append(x)
	if x < N // x:
		V.append(N // x)
V.reverse()
U.extend(V)
L = len(U)
S = [1] * L
S[0] = 0
for k in range(K - 1, -1, -1):
	T = [0] * L
	r = 0
	for i in range(1, L):
		x = U[i - 1]
		y = U[i]
		T[i] = r = ((y - x) * S[L - i] + r) % MOD
	S = T
print(S[-1])


mod = 1000000007
(n, k) = map(int, input().split())
s = int(n ** 0.5)
Num = [0] * (s + 1)
for i in range(s, 0, -1):
	Num[i] = i
	Num.append(n // i)
l = len(Num)
for i in range(1, l):
	Num[-i] = Num[-i] - Num[-i - 1]
DP = [[0] * l for _ in range(k)]
DP[0] = Num[:]
for i in range(1, k):
	tmp = 0
	for j in range(1, l):
		tmp += DP[i - 1][j]
		tmp %= mod
		DP[i][-j] = tmp * Num[-j] % mod
ans = 0
for i in DP[-1][1:]:
	ans += i
	ans %= mod
print(ans)


import math
MOD = 1000000007

def fact(n):
	ans = {0}
	for i in range(1, math.ceil(n ** 0.5) + 1):
		ans.add(i)
		ans.add(n // i)
	return sorted(list(ans))

def main():
	(N, K) = map(int, input().split())
	dp = [{} for _ in range(K + 1)]
	keys = fact(N)
	dp[1] = {f: f for f in keys}
	for i in range(1, K):
		j_prev = 0
		dp[i + 1][0] = 0
		for j in keys[1:]:
			dp[i + 1][j] = (dp[i + 1][j_prev] + (j - j_prev) * dp[i][N // j]) % MOD
			j_prev = j
	print(dp[K][N])
main()


(n, m) = map(int, input().split(' '))
Mod = 1000000007
spl = int(n ** 0.5) + 1
(f, k) = ([i for i in range(spl)] + [n // i for i in range(1, spl)][::-1], 2 * spl - 1)
dp = [0] + [1] * (k - 1)
for i in range(m):
	dp2 = [0] * k
	for j in range(1, k):
		dp2[j] = (dp2[j - 1] + dp[k - j] * (f[j] - f[j - 1])) % Mod
	dp = dp2
print(dp[k - 1])


(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
import math
SQ = int(math.sqrt(N))
DP1 = [1] * (SQ + 1)
DP1[0] = 0
DP2 = []
k = SQ
for i in range(SQ, 0, -1):
	DP2.append(N // i - k)
	k = N // i
KOSUU2 = [v for v in DP2]
for j in range(K - 1):
	NDP1 = [0] * (SQ + 2)
	NDP2 = [0] * (SQ + 1)
	for j in range(1, SQ + 1):
		NDP2[-j] -= DP1[j]
		NDP1[1] += DP1[j]
	for j in range(-1, -SQ - 1, -1):
		NDP1[-j + 1] -= DP2[j]
		NDP1[1] += DP2[j]
	for j in range(1, SQ + 2):
		NDP1[j] += NDP1[j - 1]
	NDP2[0] += NDP1[-1]
	for j in range(1, SQ + 1):
		NDP2[j] += NDP2[j - 1]
	for j in range(SQ):
		NDP2[j] = NDP2[j] * KOSUU2[j]
	DP1 = [n % mod for n in NDP1[:SQ + 1]]
	DP2 = [n % mod for n in NDP2[:SQ]]
print((sum(DP1) + sum(DP2)) % mod)


import sys
input = sys.stdin.readline
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
h = 1
t = set()
while h * h <= N:
	t.add(N // h)
	t.add(h)
	h += 1
t = sorted(t)
tt = []
for x in t:
	tt.append(N // x)
dp = [[0] * len(t) for _ in range(K + 1)]
dp[0][0] = 1
for i in range(K):
	for j in range(len(t)):
		k = len(t) - j - 1
		dp[i + 1][k] += dp[i][j]
		dp[i + 1][k] %= mod
	for k in range(len(t) - 1, 0, -1):
		dp[i + 1][k - 1] += dp[i + 1][k]
		dp[i + 1][k - 1] %= mod
		rng = (t[k] - t[k - 1]) % mod
		dp[i + 1][k] *= rng
		dp[i + 1][k] %= mod
res = 0
for j in range(len(t)):
	res += dp[-1][j]
	res %= mod
print(res)


from bisect import bisect
mod = 10 ** 9 + 7
(N, K) = map(int, input().split())
c = []
for i in range(1, int(N ** 0.5) + 1):
	c.append(i)
	c.append(int(N / i))
c = list(set(c))
c.sort()
k = []
for i in c:
	if int(N / i) != int(N / (i + 1)):
		k.append(i)
dp = [[0] * len(k) for _ in range(K)]
for i in range(len(k)):
	dp[0][i] = k[i]
inv = [0] * (len(k) - 1)
for i in range(len(k) - 1):
	inv[i] = pow(k[i + 1] - k[i], mod - 2, mod)
index = [0] * len(k)
for i in range(len(k)):
	m = int(N / (k[i] + 1))
	index[i] = bisect(k, m)
for i in range(K - 1):
	dp[i + 1][0] = dp[i][-1]
	for j in range(len(k) - 1):
		m = int(N / (k[j] + 1))
		l = index[j]
		S = dp[i][l - 1] + (dp[i][l] - dp[i][l - 1]) * (m - k[l - 1]) * inv[l - 1]
		dp[i + 1][j + 1] = dp[i + 1][j] + (k[j + 1] - k[j]) * S
		dp[i + 1][j + 1] %= mod
print(dp[-1][-1])


(N, K) = map(int, input().split())
LARGE = 10 ** 9 + 7
R = 1
while (R + 1) ** 2 < N:
	R += 1
square = False
if (R + 1) ** 2 == N:
	square = True
DP_S = [1] * R
DP_L = [1] * R
N_L = [1] * R
DP_M = 0
L = R
if square:
	DP_M = 1
	L += 1
for i in range(R, 0, -1):
	Q = N // i
	DP_L[i - 1] = Q - L
	N_L[i - 1] = Q - L
	L = Q
for _ in range(K - 1):
	S = 0
	L = sum(DP_L) + DP_M
	SS = sum(DP_S)
	for i in range(R):
		S = (S + DP_S[i]) % LARGE
		DP_S[i] = (L + SS) % LARGE
		L = (L - DP_L[i]) % LARGE
		DP_L[i] = S * N_L[i] % LARGE
	if square:
		DP_M = (DP_M + SS) % LARGE
print((sum(DP_L) + sum(DP_S) + DP_M) % LARGE)


import os
import sys
from collections import defaultdict
if os.getenv('LOCAL'):
	sys.stdin = open('_in.txt', 'r')
sys.setrecursionlimit(2147483647)
INF = float('inf')
IINF = 10 ** 18
MOD = 10 ** 9 + 7
(N, K) = list(map(int, sys.stdin.readline().split()))
nexts = []
n = N
while True:
	p = int(N // (int(N // n) + 1))
	nexts.append(n)
	if p <= 0:
		break
	n = p
dp = defaultdict(lambda : defaultdict(int))
prev = 0
for (n, m) in zip(nexts, reversed(nexts)):
	dp[0][m] = m
for k in range(1, K):
	dp[k][0] = 0
	prev = 0
	for (n, m) in zip(nexts, reversed(nexts)):
		dp[k][m] = (dp[k][prev] + dp[k - 1][n] * (m - prev)) % MOD
		prev = m
print(dp[K - 1][N])


import numpy as np
MOD = 10 ** 9 + 7

def divisor(x):
	div = [0]
	for i in range(1, int(x ** 0.5) + 1):
		div.append(i)
		if x != i ** 2:
			div.append(x // i)
	return div
(N, K) = map(int, input().split())
div = np.array(divisor(N))
div = np.sort(div)
div_dif = np.diff(div)
div_num = div.size - 1
dp = np.ones((K + 1, div_num), np.int64)
for i in range(K):
	dp[i + 1] = dp[i][::-1] * div_dif % MOD
	dp[i + 1] = dp[i + 1].cumsum() % MOD
print(dp[-1][-1])


(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
ans = 0
L = [[0, 0]]
for i in range(1, N + 1):
	if i * i == N:
		L.append([i, i])
		break
	elif i * i > N:
		break
	else:
		L.append([N // i, i])
R = []
for i in range(len(L)):
	if L[-1 - i][0] == L[-1 - i][1]:
		continue
	else:
		R.append([L[-1 - i][1], L[-1 - i][0]])
Arr = L + R
for i in range(1, len(Arr)):
	ans += pow(Arr[i][0], K - 1, mod) * (Arr[i][1] - Arr[i - 1][1])
DP = [[1 for i in range(len(Arr) - 1)] for j in range(K)]
for j in range(len(Arr) - 1):
	DP[0][j] = Arr[j + 1][1] - Arr[j][1]
for i in range(1, K):
	Rui = [DP[i - 1][0]]
	for j in range(1, len(Arr) - 1):
		Rui.append(Rui[-1] + DP[i - 1][j])
	for j in range(len(Rui)):
		DP[i][j] = Rui[-1 - j] * (Arr[j + 1][1] - Arr[j][1]) % mod
print(sum(DP[-1]) % mod)


(n, k) = [int(x) for x in input().strip().split(' ')]
mod = pow(10, 9) + 7
ll = []
ks = []
cc = 0
last = 0
for i in range(n):
	i += 1
	if n // i < i:
		last = n // i
		break
	ll.append(n // i)
	ks.append(1)
	last = n // i
	cc += 1
while True:
	if last == 0:
		break
	if last >= len(ll):
		mm = last
	else:
		mm = ll[last]
	ll.append(last * (ll[last - 1] - mm))
	ks.append(ll[last - 1] - mm)
	last -= 1
n_l = len(ll)
for _ in range(k - 2):
	nll = []
	m = sum(ll) % mod
	for i in range(n_l):
		x = n_l - i - 1
		nll.append(m * ks[i] % mod)
		m -= (mod + ll[x]) % mod
	ll = nll[:]
print(sum(ll) % mod)


import math
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7

def rev(X):
	return pow(X, mod - 2, mod)
if N <= 100:
	dp = [[0 for i in range(N + 2)] for i in range(K + 1)]
	for i in range(1, N + 1):
		dp[1][i] += 1
	for i in range(2, K + 1):
		for j in range(1, N + 1):
			dp[i][1] += dp[i - 1][j]
			dp[i][N // j + 1] -= dp[i - 1][j]
		for j in range(1, N + 2):
			dp[i][j] += dp[i][j - 1]
	ans = 0
	for i in range(1, N + 1):
		ans += dp[K][i]
	print(ans % mod)
	exit()
else:
	ans = 0
	L = 0
	for i in range(10 ** 5):
		if i ** 2 > N:
			L = i
			break
	B = N // L
	dp = [[0 for i in range(L + B)] for i in range(K + 1)]
	cnt = [0 for i in range(L + B)]
	for i in range(1, B + 1):
		dp[1][i] += 1
		cnt[i] = 1
	for i in range(B + 1, B + L):
		x = B + L - i
		dp[1][i] += N // x - N // (x + 1)
		cnt[i] = N // x - N // (x + 1)
	for i in range(2, K + 1):
		S = sum(dp[i - 1])
		for j in range(1, L + B - 1):
			dp[i][j] = S * cnt[j] % mod
			S -= dp[i - 1][-j]
		dp[i][L + B - 1] = S * cnt[L + B - 1] % mod
	for i in range(1, L + B):
		ans += dp[K][i]
		ans %= mod
	print(ans)


(n, k) = map(int, input().split())
MOD = 10 ** 9 + 7
p = int(n ** 0.5)
a = [i for i in range(1, p + 1)]
for x in range(p, 0, -1):
	if n // x != p:
		a.append(n // x)
dp = [[0 for _ in range(len(a))] for _ in range(k)]
m = len(a)
temp = 0
b = [0] * m
for (i, x) in enumerate(a):
	b[i] = x - temp
	temp = x
for i in range(m):
	dp[0][i] = b[i]
for i in range(k - 1):
	temp = 0
	for j in range(m - 1, -1, -1):
		temp = (temp + dp[i][m - 1 - j]) % MOD
		dp[i + 1][j] = temp * b[j] % MOD
print(sum(dp[-1]) % MOD)


MOD = 10 ** 9 + 7

class mint:

	def __init__(self, i):
		self.i = i

	def __add__(self, m):
		t = self.i + (m.i if isinstance(m, mint) else m)
		if t > MOD:
			t -= MOD
		return mint(t)

	def __radd__(self, m):
		t = self.i + (m.i if isinstance(m, mint) else m)
		if t > MOD:
			t -= MOD
		return mint(t)

	def __mul__(self, m):
		return mint(self.i * (m.i if isinstance(m, mint) else m) % MOD)

	def __sub__(self, m):
		t = self.i - (m.i if isinstance(m, mint) else m % MOD)
		if t < 0:
			t += MOD
		return mint(t)

	def __pow__(self, m):
		i = self.i
		return mint(pow(i, m, MOD))

	def __truediv__(self, m):
		return mint(self.i * pow(m, MOD - 2, MOD) % MOD)

	def __repr__(self):
		return repr(self.i)
(n, k) = map(int, input().split())
(l, r) = (1, n + 1)
while r - l > 1:
	c = (l + r) // 2
	if c ** 2 <= n:
		l = c
	else:
		r = c
r = l
dp = [mint(0) for _ in range(2 * r)]
dp[0] = mint(1)
for _ in range(k):
	ndp = [mint(0) for _ in range(2 * r)]
	for i in range(1, r + 1):
		pre_cnt = dp[i - 1]
		if i == r and r ** 2 == n:
			ndp[r - 1] += pre_cnt
		else:
			ndp[-i] += pre_cnt
	for i in range(1, r + 1):
		if i == r and r ** 2 == n:
			continue
		pre_cnt = dp[-i]
		upper = n // i
		lower = r + 1 if i == r else 1 + n // (i + 1)
		ndp[i - 1] += pre_cnt * (upper - lower + 1)
	acc = mint(0)
	for i in range(r * 2 - 1, -1, -1):
		if i == r and r ** 2 == n:
			continue
		acc += ndp[i]
		dp[i] = acc
ans = mint(0)
for i in range(1, r + 1):
	ans += dp[i - 1]
for i in range(1, r + 1):
	upper = n // i
	lower = r + 1 if i == r else 1 + n // (i + 1)
	ans += dp[-i] * (upper - lower + 1)
print(ans)


from math import sqrt, floor
(N, K) = map(int, input().split())
mod = 10 ** 9 + 7
sn = floor(sqrt(N))
t = N // (sn + 1)
dp1 = [0] + [1] * sn + [0]
dp2 = [0] + [N // j - N // (j + 1) for j in range(1, t + 1)]
dp2 += [0] * (len(dp1) - len(dp2))
C = dp2[:]
for _ in range(K - 1):
	d1 = [0] * (sn + 2)
	d2 = [0] * (sn + 2)
	sumd1 = 0
	for d in dp1[1:]:
		sumd1 = (sumd1 + d) % mod
	d1[1] = sumd1
	for i in range(1, sn + 1):
		d2[i] = (d2[i] + dp1[i]) % mod
		d1[1] = (d1[1] + dp2[i]) % mod
		d1[i + 1] = (d1[i + 1] - dp2[i]) % mod
	for i in range(1, sn + 2):
		dp1[i] = (d1[i] + dp1[i - 1]) % mod
		dp2[i] = (d2[i] + dp2[i - 1]) % mod
	dp1[-1] = 0
	dp2 = [d * c % mod for (d, c) in zip(dp2, C)]
ans = 0
for d in dp1:
	ans = (ans + d) % mod
for d in dp2:
	ans = (ans + d) % mod
print(ans)