let rec upper_bound l r p =
  if r <= 1 + l
  then l
  else let m = (l + r) / 2 in
       if p m 
       then upper_bound m r p
       else upper_bound l m p

let () = Scanf.scanf "%d\n" @@ fun n ->
  let k = upper_bound 0 (n + 2) @@ fun k -> k * (k - 1) / 2 <= n in
  if k * (k - 1) / 2 <> n then
    print_endline "No"
  else begin
    Printf.printf "Yes\n%d\n" k;
    for i = 0 to k - 1 do
      Printf.printf "%d" (k - 1);
      for j = 0 to k - 1 do
        if i + j <> k - 1 then
          let i, j =
            if i + j < k - 1
            then i, j
            else k - j - 1, k - i - 1 in
        Printf.printf " %d" @@ succ @@ (2 * (k - 1) - i + 1) * i / 2 + j
      done;
      print_newline ()
    done
  end
