#include using namespace std; int main() { long long n, g, h, ans; cin >> n; h = n / 2 + 1; ans = ((h % 1000007)*((n - h + 2) % 1000007 + 1000007) - 1) % 1000007; cout << ans << endl; return 0; }