fun main( args : Array ) { val c = 1000000007L val a = readLine()!!.toInt() val b = (1..a).map { x -> x.toLong() }.map { x -> x * (2 * x - 1) % c }.reduce { y, x -> y*x % c } println( b ) }