n = gets.to_i

k = -1
100_000.times{|i|
  if i*(i-1)/2==n
    k = i
  end
}

if k==-1
  puts "No"
  exit
end

#
puts "Yes"
puts k
ans = k.times.map{[k-1]}
num = 1
1.upto(k){|i|
  (i+1).upto(k){|j|
    ans[i-1] << num
    ans[(j-1)%k] << num
    num += 1
  }
}

ans.each{|x| puts x*" "}
