#include using namespace std; typedef long long ll; const ll MOD = 1000 * 1000 + 7; ll f(ll n, ll x) { ll res = 0; x = x % MOD; n = n % MOD; res = (x * -x + MOD * MOD + (n * x) % MOD + n) % MOD; return res; } int main() { ll n; cin >> n; cout << f(n, n / 2) << endl; return 0; }