QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 1024 MB 총점: 100 해킹 가능 ✓

#18676. Planting Trees

통계

Seungyeon wants to plant trees. To do this, she will select some cells on an infinite grid and plant tree seeds. The tree seeds have a mysterious power: depending on the influence of neighboring seeds, they grow into either an apple tree or a peach tree.

A seed becomes a tree according to the following rule. If two cells sharing a side both have seeds, the two seeds are said to be adjacent. A seed with an even number of adjacent seeds becomes an apple tree. On the other hand, a seed with an odd number of adjacent seeds becomes a peach tree.

Suppose Seungyeon planted 5 seeds as shown above. The adjacent seeds are indicated by blue arrows. The center seed is adjacent to 3 seeds, so it becomes a peach tree.

As a result, 3 apple trees and 2 peach trees grow as shown above.

When planting seeds, the seeds must all be connected in the grid. That is, for any two seeds, it must be possible to move between them by only stepping on adjacent seeds. For example, the following arrangement is not allowed.

Seunghyeon wants to plant exactly $A$ apple trees and $B$ peach trees. Determine whether this is possible, and if so, output an arrangement.

Input

The first line contains two non-negative integers $A$ and $B$ separated by a space. ($A \geq 0$; $B \geq 0$; $1 \le A+B \le 200$)

Output

Output the first line with YES if the arrangement is possible, otherwise NO. If possible, output the second line with the number of rows $R$ and columns $C$ separated by a space. ($1 \le R,C \le 200$) Then output $R$ lines, each containing $C$ characters without spaces. Each character is either O (a seed) or . (empty).

Examples

Input 1

3 2

Output 1

YES
3 3
.OO
OOO
...

Input 2

1 0

Output 2

YES
1 1
O

Input 3

7 0

Output 3

YES
3 3
.OO
OOO
OO.

Input 4

8 0

Output 4

YES
4 4
....
.OOO
.O.O
.OOO

Input 5

9 0

Output 5

NO

Input 6

0 7

Output 6

NO

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.