#define DEB #include #define REP(i,m) for(int i=0;i<(m);++i) #define REPN(i,m,in) for(int i=(in);i<(m);++i) #define ALL(t) (t).begin(),(t).end() #define CLR(a) memset((a),0,sizeof(a)) #define pb push_back #define mp make_pair #define fr first #define sc second using namespace std; #ifdef DEB #define dump(x) cerr << #x << " = " << (x) << endl #define prl cerr<<"called:"<< __LINE__< void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr< void debug(T a,T b){ ;} #endif template void chmin(T& a,const T& b) { if(a>b) a=b; } template void chmax(T& a,const T& b) { if(a pi; namespace std{ template ostream &operator <<(ostream& out,const pair& a){ out<<'('< struct Int_{ unsigned x; unsigned mpow(Int_ a,unsigned k){ Int_ res=1; while(k){ if(k&1) res=res*a; a=a*a; k>>=1; } return res.x; } unsigned inverse(Int_ a){ return mpow(a,mod-2); } Int_(): x(0) { } Int_(long long sig) { int sigt=sig%mod; if(sigt<0) sigt+=mod; x=sigt; } unsigned get() const { return (unsigned)x; } Int_ &operator+=(Int_ that) { if((x += that.x) >= mod) x -= mod; return *this; } Int_ &operator-=(Int_ that) { if((x += mod - that.x) >= mod) x -= mod; return *this; } Int_ &operator*=(Int_ that) { x = (unsigned long long)x * that.x % mod; return *this; } Int_ &operator=(Int_ that) { x=that.x; return *this;} Int_ &operator/=(Int_ that) { x=(unsigned long long) x * inverse(that.x)%mod; return *this;} bool operator==(Int_ that) const { return x==that.x; } bool operator!=(Int_ that) const { return x!=that.x; } Int_ operator-() const { return Int_(0)-Int_(*this);} Int_ operator+(Int_ that) const { return Int_(*this) += that; } Int_ operator-(Int_ that) const { return Int_(*this) -= that; } Int_ operator*(Int_ that) const { return Int_(*this) *= that; } Int_ operator/(Int_ that) const { return Int_(*this) /= that; } }; namespace std{ template ostream &operator <<(ostream& out,const Int_& a){ out< istream &operator >>(istream& in,Int_& a){ in>>a.x; return in; } }; typedef Int_<1000000007> Int; //const int INF=5e8; Int dp[1005][1005][2][2]; int n; int main(){ cin>>n; dp[1][0][0][0]=1; dp[2][0][0][0]=2; for(int i=2;i