local n = io.read("*n")
local a = 0
for i = 1, 1000 do
  if i * (i + 1) == n * 2 then
    a = i
    break
  end
end
if a == 0 then
  print("No")
else
  print("Yes")
  print(a + 1)
  local t = {}
  for i = 1, a + 1 do
    t[i] = {}
    for j = 1, a do t[i][j] = 0 end
  end
  local cur = 1
  for i = 1, a do
    for j = i, a do
      t[i][j] = cur + j - i
      t[j + 1][i] = cur + j - i
    end
    cur = cur + a + 1 - i
  end
  for i = 1, a + 1 do
    print(a .. " " .. table.concat(t[i], " "))
  end
end
