#include #include #include #include #include #include #include #include #include using namespace std; #define MOD 1000007 long long func(long long &n, long long i){ return ((i+1)*(n-i+1) - 1); } int main(){ long long n; cin >> n; long long ans = func(n, 1); ans = max(ans, func(n, n)); ans = max(ans, func(n, n/2) ); ans = max(ans, func(n, n/2+1) ); //cout << (n*n/4 + n)%MOD << endl; cout << ans%MOD << endl; return 0; }