n,k=map(int,input().split()) if n==k: print(int(n>1)) exit() M=10**9+7 fa=[1,1] fb=[1,1] for i in range(2,n+1): fa+=[fa[-1]*i%M] fb+=[fb[-1]*(M//i)*fb[M%i]*fa[M%i-1]*(-1)%M] c=lambda n,k:fa[n]*fb[k]*fb[n-k]%M if n>=k else 0 q=[0]*(n+1) for i in range(2,n+1): if n%i==0 and k%i==0: q[i]=c(n//i,k//i) l=n P=[1]*(l+1) for i in range(2,l+1): if P[i]: for j in range(i+i,l+1,i): P[j]=0 P=[i for i in range(2,l+1) if P[i]] for p in P: for i in range(2,n+1): if i*p<=n: q[i]-=q[i*p] else: break print(sum(q)%M)