CF1038B.Non-Coprime Partition

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Non-Coprime Partition

Find out if it is possible to partition the first nn positive integers into two non-empty disjoint sets S1S_1 and S2S_2 such that:

$$\mathrm{gcd}(\mathrm{sum}(S_1), \mathrm{sum}(S_2)) \gt 1$$

Here sum(S)\mathrm{sum}(S) denotes the sum of all elements present in set SS and gcd\mathrm{gcd} means thegreatest common divisor.

Every integer number from 11 to nn should be present in exactly one of S1S_1 or S2S_2.

Input

The only line of the input contains a single integer nn (1n450001 \le n \le 45\,000)

Output

If such partition doesn't exist, print "No" (quotes for clarity).

Otherwise, print "Yes" (quotes for clarity), followed by two lines, describing S1S_1 and S2S_2 respectively.

Each set description starts with the set size, followed by the elements of the set in any order. Each set must be non-empty.

If there are multiple possible partitions — print any of them.

Note

In the first example, there is no way to partition a single number into two non-empty sets, hence the answer is "No".

In the second example, the sums of the sets are 22 and 44 respectively. The gcd(2,4)=2>1\mathrm{gcd}(2, 4) = 2 \gt 1, hence that is one of the possible answers.

Samples

1
No
3
Yes
1 2
2 1 3 

在线编程 IDE

建议全屏模式获得最佳体验