n = gets.to_i
ans = false
a = 0
for i in 1..Math.sqrt(n).ceil+1
  if n*2 == i*(i+1)
    ans = true
    a = i+1
    break
  end
end
if ans
  puts "Yes"
  puts a
  b = Array.new(a).map{[]}
  used = Array.new(n,true)
  f = 0
  (a-1).times do |i|
    for j in f..a-i+f-2
      b[i] << j+1
      b[i+j-f+1] << j+1
      used[j] = false
    end
    f += a-i-1
  end
  b.each do |arr|
    puts "#{a-1} #{arr.join(" ")}"
  end
else
  puts "No"
end