def solve(n, t)
  arr = (1..n).to_a
  ans = []
  double = []
  arr_select = arr.dup
  t.times do
    arr_select -= ans.flatten.uniq
    next_array = []
    ans.each do |a|
      a -= double
      next_array << a[0]
      double << a[0]
    end
    k = t - next_array.length
    next_array += arr_select[0, k]
    ans << next_array
  end
  ans << arr - double
  ans.map!{ |a| [t] + a }
  ans
end

n = gets.to_i
k = 3
ok = [[3,2]]
c = 3
while k <= 100000
  k += c
  ok << [k,c]
  c += 1
end

if ok.transpose[0].include?(n)
  k = ok.transpose[0].index(n)
  puts 'Yes'
  ans = solve(n, ok[k][1])
  puts ans.size
  puts ans.map{ |a| a.join(' ') }
else
  puts 'No'
end
  