#include <bits/stdc++.h>
using namespace std;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);  
	
	const long long mod = 1e6 + 7;
	long long n;
	cin >> n;
	long long x = n / 2;
	long long y = n - x;
	x %= mod;
	y %= mod;
	cout << ((x + 1) * (y + 1) - 1 + mod) % mod << endl;
	return 0;
}