#include<bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int i, n, f[100001];
int main() {
cin.tie(0);
cout.tie(0);
cin >> n;
f[1] = 1, f[2] = 3;
for (i = 3; i <= n; ++i)
f[i] = (f[i - 1] % MOD + 2 * f[i - 2] % MOD) % MOD;
cout << f[n];
return 0;
}
评论区