atcoder#ABC236C. [ABC236C] Route Map
[ABC236C] Route Map
Score : points
Problem Statement
There are stations on a certain line operated by AtCoder Railway. The -th station from the starting station is named .
Local trains stop at all stations, while express trains may not. Specifically, express trains stop at only stations, and the -th stop is the station named . Here, it is guaranteed that and , that is, express trains stop at both starting and terminal stations.
For each of the stations, determine whether express trains stop at that station.
Constrains
- and are integers.
- is a string of length between and (inclusive) consisting of lowercase English letters.
- and .
- is obtained by removing zero or more strings from and lining up the remaining strings without changing the order.
Input
Input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain Yes
if express trains stop at the -th station from the starting station, and No
otherwise.
5 3
tokyo kanda akiba okachi ueno
tokyo akiba ueno
Yes
No
Yes
No
Yes
7 7
a t c o d e r
a t c o d e r
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Express trains may stop at all stations.