{-# LANGUAGE BangPatterns #-}
import Control.Arrow
import Control.Monad.Fix
import Data.Int
import Data.Foldable
import Data.List
import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
import qualified Data.Map.Strict as M
import qualified Data.ByteString.Char8 as B
import Data.ByteString.Internal (accursedUnutterablePerformIO)
import Debug.Trace

solve :: Int -> Maybe (M.Map Int [Int])
solve !n = flip fmap mayGetGroupNum $ \k ->
  foldl' (\(!mp) (!i, (!x, !y)) -> M.adjust (i :) x $ M.adjust (i :) y mp)
         (M.fromList $ zip [1 .. k] $ repeat [])
    $ zip [1 ..] [ (x, y) | x <- [1 .. k], y <- [x + 1 .. k] ]
 where
  getMaySquare n =
    let sn = floor (sqrt $ fromIntegral n)
    in  if sn ^ 2 == n then Just sn else Nothing

  mayGetGroupNum = fmap (\s -> (1 + s) `div` 2) $ getMaySquare (1 + 8 * n)

main = do
  let readInt :: Integral a => B.ByteString -> Maybe (a, B.ByteString)
      readInt = fmap (first fromIntegral . second B.tail) . B.readInt

  n <- (\vec -> (vec VU.! 0)) . VU.unfoldrN 1 readInt <$> B.getLine
  let ma = solve n
  case ma of
    Nothing -> putStrLn "No"
    Just mp -> do
      putStrLn "Yes"
      print $ M.size mp
      forM_ (M.toList mp) $ \(_, xs) -> do
        putStr $ show $ length xs
        mapM_ (putStr . (' ' :) . show) xs
        putStrLn ""
