#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rep2(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define rev(i, n) for (int (i) = (n)-1; (i) >= 0; (i)--)
#define rev2(i, a, b) for (int (i) = (a)-1; (i) >= (b); (i)--)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pll = pair<long long, long long>;
template<class T> using Vec = vector<T>;
template<class T> using VVec = vector<vector<T>>;
long long TEN(int i) {return !i ? 1 : TEN(i-1)*10LL;}
template<class T, class U> 
bool chmin(T& a, const U& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T, class U> 
bool chmax(T& a, const U& b) {if (a < b) {a = b; return 1;} return 0;}

struct IoSetup {
	IoSetup() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(10);
	}
} iosetup;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

template<long long mod>
class ModInt {
public:
	long long v;
	ModInt(long long v = 0) : v((v % mod + mod) % mod) {}
	ModInt operator+(ModInt t) {return ModInt((v + t.v) % mod);}
	ModInt operator-(ModInt t) {return ModInt((v - t.v + mod) % mod);}
	ModInt operator*(ModInt t) {return ModInt((v * t.v) % mod);}
	ModInt operator+=(ModInt t) {return *this = *this + t;} 
	ModInt operator-=(ModInt t) {return *this = *this - t;}
	ModInt operator*=(ModInt t) {return *this = *this * t;}
	ModInt operator-() {return ModInt(-v);}
	ModInt mpow(long long t) {
		if (t == 0) return ModInt(1);
		ModInt a = mpow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	ModInt inv() {return mpow(mod - 2);}
	ModInt operator/(ModInt t) {return ModInt(v) * t.inv();}
	ModInt operator/=(ModInt t) {return *this = *this / t;}
	ModInt operator==(ModInt t) {return *this.v == t.v;}
	ModInt operator!=(ModInt t) {return *this.v != t.v;}
	friend ostream& operator<<(ostream& os, const ModInt& mi) {return os << mi.v;}
};

const ll mod = 1000000007;
using mint = ModInt<mod>;

template<const long long mod>
class BinominalCoefficient {
public:
    using mint = ModInt<mod>;

    int MAX;
    vector<mint> fac, inv, finv;
    BinominalCoefficient(int MAX = 2000005) {
        this->MAX = MAX;
        fac = vector<mint>(MAX, 1);
        inv = vector<mint>(MAX, 1);
        finv = vector<mint>(MAX, 1);
        for (int i = 2; i < MAX; ++i) {
            fac[i] = fac[i - 1] * mint(i);
            inv[i] = -inv[mod % i] * mint(mod / i);
            finv[i] = finv[i - 1] * inv[i];
        }
    }
    mint com(int n, int k) {
        if (k > n || n < 0 || k < 0) return 0;
        return fac[n] * finv[k] * finv[n - k];
    }
    mint Okcom(int n, int k) {
        if (k > n || n < 0 || k < 0) return 0;
        mint ans = 1;
        for (int i = 0; i < k; i++) {
            ans *= mint(n - i) * inv[k - i];
        }
        return ans;
    }
};


int main() {
	BinominalCoefficient<mod> bc;

	ll N;
	cin >> N;

	if (N == 1) {
		cout << 0 << endl;
		return 0;
	}

	mint ans = mint(0);
	for (int i = 2; i <= N; i++) {
		ans += bc.com(N, i) * (mint(2).mpow((ll)i) - mint(2)) * mint(8).mpow(N - i);
	}

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 50116