#include using namespace std; typedef long long ll; int main(){ ll n; ll ans; ll mod = 1000007; cin >> n; n += 2; ll A = (n/2)%mod; ll B = (n/2 + 1)%mod; if(n % 2 == 1){ ans = (A*B)%mod - 1; }else{ ans = (A*A)%mod - 1; } cout << ans << endl; return 0; }