class Integer
  def divisor_list
    require 'prime'

    return [] if self <= 0
    return [1] if self == 1

    prime_division.map.with_index { |(base, k), i|
      s = i.zero? ? 0 : 1
      (s..k).map { |n| base ** n }
    }.inject { |res, e| res + res.flat_map { |t| e.map { |v| t * v } } }.sort
  end
end

N = gets.to_i
V = 2 * N

r = V.divisor_list.find { |n| m = V / n; m - n == 1 }

if r.nil?
  puts 'No'
  exit
end

S = []
v = 0
counter = Hash.new(0)

m = V / r

m.times do
  s = []

  r.times do
    while counter[v] >= 2
      v = (v + 1) % N
    end

    s << v + 1
    counter[v] += 1
    v = (v + 1) % N
  end

  v = (v - 1 + N) % N

  S << s
end

puts 'Yes'
puts S.size
S.each do |s|
  puts [s.size, s.join(' ')].join(' ')
end
