#C556. Construct Array with Maximum Power Limit

    ID: 49222 Type: Default 1000ms 256MiB

Construct Array with Maximum Power Limit

Construct Array with Maximum Power Limit

Given two integers \(n\) and \(k\), determine whether it is possible to construct an array \(A\) of length \(n\) such that the array can only contain successive integers starting from 0. The catch is that the maximum allowed value in \(A\) must not exceed \(k\) by the conditions of the problem.

An array \(A = [0, 1, \ldots, n-1]\) is valid if and only if \(n \leq k+1\). If \(n > k+1\), it is impossible to construct such an array. If it is possible, output "YES" followed by the array; otherwise, output "NO".

inputFormat

The input is given via standard input. The first line contains two space-separated integers \(n\) and \(k\), representing the length of the array and the maximum allowed power level respectively.

outputFormat

Output to standard output. If a valid array can be constructed, print "YES" on the first line, followed by the constructed array (\(n\) space-separated integers) on the second line. Otherwise, print only "NO".

## sample
3 2
YES

0 1 2

</p>