mod=10**9+7 n=int(input()) if n==2: print(1) exit() if n==3: print(3) exit() ans=0 for i in range(2,int(n**0.5)+1): tn=n while tn!=0: ans+=tn%i tn//=i ans%=mod for i in range(1,int(n**0.5)): l=n//(i+1)+1 r=n//i ans+=i*(r-l+1) ans+=i*(((r-l)*(r-l+1))//2)+(n%r)*(r-l+1) ans%=mod print(ans)