output_description: If a tuple of subsets of \\{1,2,...N\\} that satisfies the conditions does not
  exist, print `No`. If such a tuple exists, print `Yes` first, then print such
  subsets in the following format:
  
      
      
      k
      |S_1| S_{1,1} S_{1,2} ... S_{1,|S_1|}
      :
      |S_k| S_{k,1} S_{k,2} ... S_{k,|S_k|}
      
  
  where S_i={S_{i,1},S_{i,2},...,S_{i,|S_i|}}.
  
  If there are multiple such tuples, any of them will be accepted.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: ans_data = []
  
  
  def get_num_shugou(num):
      num_shuugou = -1
      for i in range(1, num + 2):
          if 2 * num == i * (i - 1):
              num_shuugou = i
              break
          elif 2 * num < i * (i - 1):
              break
      return num_shuugou
  
  
  def get_piramid(num_shuugou):
      piramid = [[1]]
      for i in range(num_shuugou - 2):
          data = [piramid[-1][-1] + j + 1 for j in range(len(piramid) + 1)]
          piramid.append(data)
      return piramid
  
  
  def data_append(now_list):
      print("{} {}".format(len(now_list), " ".join(list(map(str, now_list)))))
  
  
  def make_data(high, width, piramid, now_list_kari, down_flg):
      now_list = now_list_kari.copy()
      now_list.append(piramid[high][width])
  
      if len(now_list) == len(piramid):
          data_append(now_list)
          return
  
      if down_flg:
          make_data(high + 1, width, piramid, now_list, down_flg)
  
      elif width == len(piramid[high]) - 1:
          down_flg = 1
          make_data(high + 1, width, piramid, now_list, down_flg)
      else:
          make_data(high, width + 1, piramid, now_list, down_flg)
  
  
  def write_shugou(num_shuugou):
      piramid = get_piramid(num_shuugou)
  
      now_list = [piramid[i][-1] for i in range(len(piramid))]
      data_append(now_list)
      for i in range(num_shuugou - 1):
          make_data(i, 0, piramid, [], 0)
  
  
  def main():
      num = int(input())
      num_shuugou = get_num_shugou(num)
      if num_shuugou == -1:
          print("No")
      else:
          print("Yes")
          print(num_shuugou)
          write_shugou(num_shuugou)
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  You are given an integer N. Determine if there exists a tuple of subsets of
  \\{1,2,...N\\}, (S_1,S_2,...,S_k), that satisfies the following conditions:
  
    * Each of the integers 1,2,...,N is contained in exactly two of the sets S_1,S_2,...,S_k.
    * Any two of the sets S_1,S_2,...,S_k have exactly one element in common.
  
  If such a tuple exists, construct one such tuple.
samples: [{"input": "3", "output": "Yes\n    3\n    2 1 2\n    2 3 1\n    2 2 3\n    \n\nIt can be seen that (S_1,S_2,S_3)=(\\\\{1,2\\\\},\\\\{3,1\\\\},\\\\{2,3\\\\}) satisfies\nthe conditions.\n\n* * *"}, {"input": "4", "output": "No"}]