#include <bits/stdc++.h>
using namespace std;
long long int a[100100];
long long int x[100100] = {0};
set<pair<long long int, long long int> > st;
inline long long int solve(long long int x) {
  for (long long int i = 0; i < ((long long int)((x + 1) / 2)); i++) {
    long long int j = x - i;
    st.insert({i, j});
  }
  return ((long long int)(st).size());
}
inline string print_binary(long long int x) {
  vector<long long int> v;
  while (x > 0) {
    v.push_back(x & 1);
    x /= 2;
  }
  reverse((v).begin(), (v).end());
  stringstream ss;
  for (long long int i = 0; i < ((long long int)(((long long int)(v).size())));
       i++)
    ss << v[i];
  return ss.str();
}
long long int res[2002];
inline long long int solve2(long long int x) {
  long long int ans = 1;
  long long int nn = ((x + 1) / 2) % 1000000007;
  ans += ((nn + 1) * nn) % 1000000007;
  if (x % 2 > 0) {
    ans = (ans + 1000000007 - nn) % 1000000007;
  }
  return ans;
}
int main() {
  long long int n;
  cin >> n;
  cout << solve2(n) << endl;
  return 0;
}
