n = gets.chomp.to_i

if n == 1
  puts 'Yes'
  puts '2'
  puts '1 1'
  puts '1 1'
  exit
end

if n == 3
  puts 'Yes'
  puts '3'
  puts '2 1 2'
  puts '2 3 1'
  puts '2 2 3'
  exit
end

oks = [1]
2.upto(10**5) do |i|
  if i == (oks.last + oks.size + 1)
    oks.push(i)
  end
end

if !oks.include?(n)
  puts 'No'
  exit
end

num = oks.index(n) + 1

ans = Array.new(num + 1) { Array.new }
counts = Array.new(n, 0)

i = 1
(1..num + 1).to_a.combination(2) do |a, b|
  ans[a-1].push(i)
  ans[b-1].push(i)
   i += 1
end

puts 'Yes'
p num + 1
ans.each do |an|
  puts "#{an.size} #{an.join(' ')}"
end
