import numpy as np

def __gcd(a,b):
    pass
mod = int(1e9)+7

def muj_mul(a,b, n):
    out = np.zeros((n,n), dtype=np.int64)
    for i in range(n):
        for k in range(n):
            if a[i][k] == 0:
                continue
            for j in range(n):
                out[i][j] += a[i][k] * b[k][j]
                out[i][j] = out[i][j] % mod
    return out

def pow(mat, p):
    from copy import deepcopy
    b = deepcopy(mat)
    mat = np.eye(mat.shape[0], dtype=np.int64)
    n = mat.shape[0]
    while (p):
        if p & 1:
            mat = muj_mul(mat, b, n)
            #mat = mat @ b
        #b = (b @ b) % mod
        b = muj_mul(b,b,n)
        p>>=1

    return mat



k,n = map(int, input().split())
vals = np.ones((k), dtype=np.int64)
mat = np.zeros((k,k), dtype=np.int64)
for i in range(k):
    for j in range(k):
        ii = i+1
        jj = j+1
        gcdd = np.gcd(ii, jj)
        should = gcdd == 1
        mat[i][j] = should

# 42 75097099101114
print(mat)
if(n>1):
    mat = pow(mat, n-1)
    vals = (mat @ vals) % mod

#print(mat)
ans = sum(vals) % mod
ans = ans % mod
#print(mod)
print(ans)




