Ships#629

Ships

1 second
64 megabytes
Hard

Probably everyone who ever attended school knows the game where two players place a set of ships on a grid and try to find and eliminate each other's ships by guessing their locations.

In our version of the game, both you and your opponent may use the following seven ship patterns, placing them on a rectangular grid:

Each ship covers exactly four squares. Ships may be rotated but not mirrored. All ships are guaranteed to be placed entirely within the given rectangle, without overlapping each other. Ships are allowed to touch other ships or the border.

You may assume we are in the middle of the game and some squares are already uncovered. You are given a rectangular grid showing your current knowledge about the positions of your opponent's ships. Each square is represented by one of these characters:

Given this information, decide if it is possible to determine the positions of all remaining 'x' squares with at most one miss. That is, can you uncover all '.' squares, getting at most one 'o' (miss), before finding all the 'x' squares? In other words, you are allowed to hit one 'o', if this makes the remaining solution unique.

Input

The input file contains several game situations. Each test case starts with a line containing two integers and , the width and height of the grid, where 2 \leq w, h \leq 16.

Each of the next lines contains a string of characters. Each character is 'x', 'o' or '.', depending on the state of that square.

A blank line separates each game from the next. The input ends with a case where w = 0 and h = 0; do not process this case.

Output

For each test case, first output the game number (see the sample output), then output either 'yes.' (if you can determine all 'x' with at most one miss) or 'no.' (if you cannot determine all 'x' without at least two misses).

Output a blank line after each game.

Examples

Example 1

Loading
Loading