#include"bits/stdc++.h" usingnamespace std; #define fi first #define se second #define vi vector<int> #define pb push_back #define eb emplace_back #define pii pair<int,int> #define mp make_pair #define rep( i , a , b ) for( int i = (a) , i##end = b ; i <= i##end ; ++ i ) #define per( i , a , b ) for( int i = (a) , i##end = b ; i >= i##end ; -- i ) #define mem( a ) memset( a , 0 , sizeof (a) ) #define all( x ) x.begin() , x.end() //#define int long long // #pragma GCC optimize(2) typedeflonglong ll; constint MAXN = 2e6 + 10; constint P = 1e9 + 7; int n , m , q;
intPow( int x , int a ){ int ret = 1; while( a ) { if( a & 1 ) ret = ret * 1ll * x % P; x = x * 1ll * x % P , a >>= 1; } return ret; }
int J[MAXN] , iJ[MAXN]; voidsolve(){ cin >> n; J[0] = J[1] = 1; rep( i , 2 , n * 2 ) J[i] = J[i - 2] * 1ll * i % P; iJ[n * 2] = Pow( J[n * 2] , P - 2 ) , iJ[n * 2 - 1] = Pow( J[n * 2 - 1] , P - 2 ); per( i , n * 2 , 2 ) iJ[i - 2] = iJ[i] * 1ll * i % P; int ret = 0 , las = 0; rep( i , 0 , n - 1 ) { int S = Pow( 2 * n , P - 2 ); int res = J[2 * n - 2 - i + 1] * 1ll * iJ[2 * n - 2 - i] % P * J[i] % P * iJ[i + 1] % P * S % P * ( i + 1 ) % P; ret = ( ret + ( res + P - las ) * 1ll * i ) % P; las = res; } cout << ( ret * 2ll + n ) % P << endl; }