King's Puzzle#11330

King's Puzzle

1 second
128 megabytes
Easy

King Kendrick is a sovereign ruler of Kotlin Kingdom. He is getting ready for the next session of the government. Kotlin Kingdom consists of cities. These cities need to be connected by several bidirectional roads. Since ministries are responsible for aspects of safety and comfort of the kingdom's residents, some of them have made the following requirements:

King Kendrick has issues with the requirements from the Ministry of ICPC. He asks you to help him. Find any set of roads that suits all the requirements above or say that it is impossible.

Input

Two integers and k~(1 \le k \le n \le 500).

Output

If it is impossible to satisfy all the requirements, output "NO".

Otherwise:

  • in the first line output "YES".

  • in the second line output the number of roads m~(0 \le m \le n \cdot (n - 1) / 2).

  • in the next lines output pairs of integers and b~(1 \le a, b \le n) — the cities to connect by a road.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading