CF28A Bender Problem
Description
Robot Bender decided to make Fray a birthday present. He drove $ n $ nails and numbered them from $ 1 $ to $ n $ in some order. Bender decided to make a picture using metal rods. The picture is a closed polyline, which vertices should be nails (in the given order). The segments of the polyline should be parallel to the coordinate axes. Polyline is allowed to have self-intersections. Bender can take a rod and fold it exactly once in any place to form an angle of 90 degrees. Then he can attach the place of the fold to some unoccupied nail and attach two ends of this rod to adjacent nails. A nail is considered unoccupied if there is no rod attached to it (neither by it's end nor the by the fold place). No rod could be used twice. It is not required to use all the rods.
Help Bender to solve this difficult task.
Input Format
The first line contains two positive integers $ n $ and $ m $ ( $ 4
Output Format
If it is impossible to solve Bender's problem, output NO. Otherwise, output YES in the first line, and in the second line output $ n $ numbers — $ i $ -th of them should be the number of rod, which fold place is attached to the $ i $ -th nail, or -1, if there is no such rod.
If there are multiple solutions, print any of them.