#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair P; const ll MOD=1e9+7; int main() { int n; cin>>n; ll dp[2010]; ll s[2010]; for(int i=0; i<=n; i++) s[i]=i; for(int i=n-1; i>=2; i--){ for(int j=1; j<=n; j++){ dp[j]=(s[n]-s[max(0, j-i+1)]+MOD)%MOD; } for(int j=1; j<=n; j++) s[j]=(s[j-1]+dp[j])%MOD; } ll ans=0; for(int i=2; i<=n; i++){ (ans+=(s[n]-s[i-1]+MOD))%=MOD; } for(int i=0; i=2; i--){ for(int j=1; j<=n; j++){ dp[j]=(s[n]-s[max(0, j-i+1)]+MOD)%MOD; } for(int j=1; j<=n; j++) s[j]=(s[j-1]+dp[j])%MOD; } (ans+=s[n])%=MOD; cout<