#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<cstdlib>
#define sfor(i, h, t) for(int i = (h); i <= (t); ++i)
#define dfor(i, t, h) for(int i = (t); i >= (h); --i)
#define il inline
#define ms(x, i) memset(x, i, sizeof x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef long double ldb;
const ll P = 1000000007ll;
int N;
signed main(void) {
    freopen("barrack.in", "r", stdin);
    freopen("barrack.out", "w", stdout);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    ull ans = 0;
    sfor(i, 1, N)
        ((ans <<= 15) += rand()) %= P;
    cout << (ans % P);
    return !bool(cout << '\n');
}