open Printf
open Scanf

let id x = x
let pair x y = x, y

let n = scanf "%d" id

let sqrt_int n = int_of_float (sqrt (float n))

let rec next2 vs i =
  if vs.(i) = 2 then (vs.(i) <- 1; i)
  else next2 vs (i + 1)

let rec next1 vs i =
  if vs.(i) = 1 then (vs.(i) <- 0; i)
  else next1 vs (i + 1)
  
let calc a b =
  print_endline "Yes";
  printf "%d\n" b;
  let vs = Array.init n (fun _ -> 2) in
  for j = 0 to b - 1 do
    printf "%d " a;
    for i = 0 to a - 1 do
      if i < j then begin
        let x = next1 vs 0 in
        printf "%d " (x + 1)
      end else begin
        let x = next2 vs 0 in
        printf "%d " (x + 1)
      end
    done;
    printf "\n"
  done

let () =
  let a = sqrt_int (n * 2) in
  if a * (a + 1) = n * 2 then
    calc a (a + 1)
  else
    print_endline "No"

