import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.NoSuchElementException; class Main { public static void main(String[] args) { new Main().run(); } void run() { solve(); } long mod=(long)1e9+7; long pow(long a, long n) { if (n==0) return 1; return pow(a*a%mod,n/2) * (n%2==1?a:1) %mod; } long inv(long a) { return pow(a, mod-2); } long sum(long x,long e) { return (1-pow(x,e+1)-(1-x)*pow(x,e)%mod*(e+1)%mod)%mod * inv((1-x)*(1-x)%mod) % mod; } long f(long p, long e) { return pow(p,e)*sum(inv(p),e+1)%mod; } void solve() { FastScanner sc=new FastScanner(); PrintWriter pw=new PrintWriter(System.out); long ans=1; int L=sc.nextInt(); for (int i=0;i