fun main(args: Array<String>) {
    val N = readInputLine().toInt()

    var rank = 1

    while (true) {
        val num = rank * (rank + 1) / 2
        if (num == N) {
            break
        }
        if (num > N) {
            println("No")
            return
        }
        rank++
    }

    println("Yes")
    println(rank + 1)

    val ans = Array(rank + 1) { mutableListOf<Int>() }

    var top = 0
    var btm = 1

    for (i in 1..N) {
        ans[top].add(i)
        ans[btm].add(i)

        if (ans[top].size == rank) {
            top++
            btm = top + 1
        } else {
            btm++
        }
    }

    for (i in 0..rank) {
        println("$rank ${ans[i].joinToString(" ")}")
    }
}

fun readInputLine(): String {
    return readLine()!!
}
