// Arup Guha
// 6/6/2023
// Solution to CSES problem: https://cses.fi/problemset/task/1082 (Sum of Divisors)

using namespace std;
#include <iostream>
typedef long long ll;

# Constants we need.
const ll MOD = 1000000007ll;
const ll TWOINV = 500000004ll;

int main() {

    ll n, res = 0;
    cin >> n;

    // Stop by square root, we'll add in our contributions in two ways.
    for (ll i=1; i*i<=n; i++) {

        // This is contribution of i. i appears n/i times as a divisor.
        res = (res + i*(n/i) )%MOD;

        // Contribution of all integers that appear i times.
        if (n/i > i) {

            // This is the smallest integer that appears i times.
            ll low = (n+1+i+1-1)/(i+1);

            // This is the largest integer that appears i times.
            ll high = n/i;

            // Watch out for overflow here. We want this arithmetic sum.
            ll total = ((low+high)%MOD)*((high-low+1)%MOD);

            // Under mod though.
            total %= MOD;

            // We can't divide under mod, so we multiply by 2 inverse.
            total = (total*TWOINV)%MOD;

            // Add in the contribution.
            res = (res + total*i)%MOD;
        }
    }

    // Ta da!
    cout << res << endl;

    return 0;
}
