#include using namespace std; typedef long long ll; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) const int mod = 1000007; int main(){ ll N; cin >> N; ll u = N/2, l = N/2; if(N % 2 != 0) l++; cout << ((l%mod+1)*u%mod+l%mod)%mod << endl; return 0; }