class Combinator
  MAX = 1100000 # nCkの最大のnより大きいこと。MODより小さいこと。
  MOD = 1000000007

  def initialize
    @fac = Array.new(MAX)
    @fac[0] = 1
    @fac[1] = 1
    @finv = Array.new(MAX)
    @finv[0] = 1
    @finv[1] = 1
    @inv = Array.new(MAX)
    @inv[1] = 1
    (2..(MAX-1)).each do |i|
      @fac[i] = @fac[i-1]*i%MOD
      @inv[i] = MOD-@inv[MOD%i]*(MOD/i)%MOD
      @finv[i] = @finv[i-1]*@inv[i]%MOD
    end
  end

  def call(all, select)
    return 0 if all < select
    return 0 if all < 0||select < 0
    @fac[all]*(@finv[select]*@finv[all-select]%MOD)%MOD
  end
end
@combinator = Combinator.new

n = gets.to_i
if n < 2
  puts 0
  exit 0
elsif n == 2
  puts 2
  exit 0
end

mod = 1000000007
sum = 0
(2..n).each do |i|
  sum += ((((2.pow(i, mod) - 2) % mod) * 8.pow(n-i, mod)) % mod) * @combinator.call(n, i)
  sum %= mod
end
puts sum
