#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; #define fi first #define se second #define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++) #define rep(i,n) repl(i,0,n) #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="<y?x:y) #define mmin(x,y) (x0){ if(n&1)res=res*x%mod; x=x*x%mod; n>>=1; } return res; } ll n; ll fac[1000001],finv[1000001]; ll comb(ll a,ll r){ if(a<0||r<0||a-r<0)return 0; return (fac[a]*finv[r]%mod)*finv[a-r]%mod; } int main(){ fac[0]=1; rep(i,1000001){ fac[i+1]=fac[i]*(i+1)%mod; finv[i]=mod_pow(fac[i],mod-2); } cin>>n; ll res=1; for(ll x=n+1,y=1;x+y<=2*n;x++,y++){ ll xx=x-1,yy=y; ll rx=xx-n,ry=yy+n; (res+=comb(x+y-1,x-1)-comb(rx+ry,rx)+mod)%=mod; } cout<