n = gets.to_i * 2

k = 1
k += 1 while k * (k - 1) < n

if k * (k - 1) != n
    puts "No"
    exit
end

puts "Yes", k

x = []
i = 0
k.times do |j|
    y = []
    (k-j-1).times {y << i += 1}
    puts "#{k-1} " + (x.map{|e| e.shift} + y) * " "
    x << y
end