import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func mainC() {
    let N = readInt()

    // NC2を求める
    let NC2 = N * (N - 1) / 2

    if N > 2 {
        // 超複数を求める
        var double = 0

        double += (N - 2) * 2

        let Nh2C2 = (N - 2) * (N - 3) / 2
        double += Nh2C2 * 2

        // 結果
        var result = NC2 * 2
        for _ in 0..<(N-2) {
            result = result * 10
            result %= (1000_000_000 + 7)
        }

        result -= (double % (1000_000_000 + 7)) * (NC2 % (1000_000_000 + 7))
        result %= (1000_000_000 + 7)
        print(result)
    } else {
        print(NC2 * 2)
    }
}
mainC()