Drunk king is a piece which moves as a usual chess king (i. e. to one of eight adjacent cells), but cannot make two consecutive moves in the same direction. Drunk king stands in an upper-left corner of an N × M chessboard and wants to visit each cell exactly once and return to initial position. His path must have no self-intersections.
Here are the examples of correct tours:
Help the king to find the required tour.
Input
The only input line contains 2 integers: N and M
(2 ≤ N, M ≤ 500).
Output
In the first line output “Yes” or “No” depending on whether the required tour exists. If the tour exists, output it in the next 2N − 1 lines with symbols “o” (ASCII code 111), “|” (code 124), “-” (code 45), “/” (code 47), “\” (code 92) and spaces. Each of these lines should contain exactly 2M − 1 symbols. Use the format shown in the sample below. If there are many tours, you can output any of them.
Samples
input | output |
---|
6 8
| Yes
o-o o-o o-o o-o
| \| |/ |/ |
o-o o o o o o-o
| / \ \
o-o o-o o-o o-o
| \ \ \
o-o o-o o-o o-o
| \ \ \
o-o o o o-o o o
| /| | | /| |
o-o o-o o-o o-o
|
5 5
| No |
Problem Author: Igor Chevdar
Problem Source: Ural SU Contest. Petrozavodsk Summer Session, August 2008