N, K = gets.split.map(&:to_i) if K == 1 puts 'Yes' puts [*1..N].join(' ') exit end if N % K != 0 puts 'No' exit end S = N * (1 + N) / 2 cnt = N / K if S % K != 0 puts 'No' exit end queue = [*1..N] puts 'Yes' v = 1 K.times do values = [] cnt.times do if v > 0 values << queue.shift else values << queue.pop end v *= -1 end puts values.join(' ') end