"use strict"
// const fact = n => (n===0) ? 1 : (n*fact(n-1));
function main(arg) {
    let N = arg.trim().split("\n").map(Number)[0]
    const _10e9_7 = 10e9 + 7
    // console.log(npr(N,2))
    // console.log(npr(N,2) * Math.pow(9, N-2))
    if (N === 1) {
        console.log(0)
        return
    }
    // console.log(npr2(N))
    // let tmp = n
    let a = 1
    for (let i = 3; i <= N; i++) {
        a *= 9
        a %= 1000000007
    }
    let ans = fix(N)*fix(N-1)*a
    // console.log(ans)
    console.log(ans % (1000000007))
    // console.log(npr2(10e6) % _10e9_7)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

function npr2(n) {
    return n * (n - 1)
}

function fix(n) {
    return n % 1000000007
}

function npr(n,r) {
    return fact(n) / fact(n-r)
}

function fact(k) {
  var j = 1;
  for(var i = 1; i <= k; i++){
    j *= i;
  }
  return j;
}