#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() const ll mod = 1e6 + 7; int main() { cin.tie(nullptr); ll N; cin >> N; ll mid = N / 2; ll t1 = mid % mod; ll t2 = (N - mid) % mod; N %= mod; cout << (t1 * t2 % mod + N) % mod << '\n'; }