G. tourist#2576

G. tourist

3 seconds
256 megabytes
Hard

The road system of Lemuria is quite complicated. Some of its cities are connected by one-way or two-way roads. However, the lemurs keep their roads in good condition, and their road maps are always up to date.

G. the tourist has just arrived by Penguin Air to city in Lemuria. The return flight departs from city . G. has a list of the most popular attractions in Lemuria and plans to visit all of them. He also has the latest version of the road map, which means that for every city , he has a list of cities that can be reached directly from . Your task is to help the tourist plan a route across Lemuria that starts at , passes through all cities with attractions (in any order), and ends at .

Input

The first line contains four integers: the number of cities in Lemuria (1 \leq N \leq 2000), the number of cities with attractions (0 \leq K \leq N), and the numbers of the cities and (all cities are numbered starting from ).

The second line contains distinct numbers — the numbers of the cities with attractions.

The last lines describe the road map. Each line contains characters: if the -th character of the (p + 2)-th input line is , then there is a direct road from city to city ; if it is , then there is no direct road. There are no roads from a city to itself.

Output

If no route satisfies the conditions, output a single line: NO. Otherwise, output YES on the first line, the number of cities (M \leq N^2) in the route on the second line, and then in the next line(s), numbers — the cities in the route. The first city must be , the last . For any two consecutive cities in the route, there must be a direct road from the first city to the second one.

Examples

Example 1

Loading
Loading