def allow?(n)
  (10**5).times { |i|
    return true if allowed(i) == n
    return false if allowed(i) > n
  }
end

def get_ele_size(n)
  return 0 unless allow?(n)
  (10**5).times { |i|
    return 2 + i if allowed(i) == n
  }
end

def allowed(n)
  return (n+3)*(n+2)/2
end

n = gets.chomp.to_i
puts continue = allow?(n) ? "Yes" : "No"
exit unless continue == "Yes"

ele_size = get_ele_size(n)
subsets_size = ele_size + 1
subsets = []
subsets_size.times { |i|
  subsets[i] = []
}

target_1 = 0
target_2 = target_1

(1..n).each { |a|
  subsets[target_1] << a
  subsets[target_2+1] << a

  target_2 += 1

  if subsets[target_1].length == ele_size
    target_1 += 1
    target_2 = target_1
  end
}

puts subsets_size
subsets.each { |subset|
  puts "#{ele_size} #{subset.join(" ")}"
}
