Consider a tree on n vertices. Each pair of vertices is connected by a simple path. Your task is to construct a tree on n vertices such that the total length of paths between all unordered pairs of vertices is exactly m. The length of a path is the number of edges on the path.
First line of the input contains two integers n and m (2 ≤ n ≤ 20, 1 ≤ m ≤ 10 000).
If it is impossible to construct such a tree, print "NO".
Otherwise, print "YES" on the first line. Each of the next n - 1 lines must describe one edge and contain two integers between 1 and n: the numbers of vertices connected by the corresponding edge.
If more than one correct tree exists, you may print any one of them.
3 4
YES
1 2
2 3
3 5
NO
| Name |
|---|


