#K91377. Integer Flow

    ID: 37962 Type: Default 1000ms 256MiB

Integer Flow

Integer Flow

You are given a single integer \(n\) and your task is to determine if there exists a permutation of the integers from 1 to \(n\) such that the absolute difference between any two consecutive digits is at most 2.

If such a permutation exists, you should output "YES" on the first line followed by the permutation on the second line (the digits separated by a single space). Otherwise, output "NO" in a single line.

Note: For \(n < 4\), it is always possible to form such a permutation. In the special case of \(n = 4\), the permutation [1, 3, 2, 4] is a valid solution. For all \(n \geq 5\), no valid permutation exists.

inputFormat

The input consists of a single integer \(n\) given via standard input.

outputFormat

If a valid permutation exists, output "YES" in the first line and the permutation (space-separated) in the second line. Otherwise, output "NO".

## sample
1
YES

1

</p>