DRM Inc. is a firm that produces digital road maps. A digital map is a set of places and a set of streets between places. Streets are not oriented, i.e., they are two-way streets. A road between a place a and a place b is a sequence of places ⟨u0, u1, ..., un⟩ such that a = u0, b = un, and there is a street between ui and ui+1 for 0 ≤ i < n. The definition of a map is accomplished incrementally: a new version of a map is built adding details to an already defined one. The new map must be consistent with the old one, i.e., the new one must be more detailed than the old one, in the sense that
DRM building process includes a comparison step between consecutive map versions in order to assure consistence between them. You must help DRM to evaluate if a map is more detailed than another one.
A map is represented with several input lines:
An identifier is a character string without blanks. The problem input describes several cases, each one consisting of a pair of map representations. For each case you must evaluate if the second map of the given pair is a more detailed version of the first one. The end of the input is specified by a line with the word END.
Output texts for each input case are presented in the same order that input is read. For each pair of maps named < id1 > and < id2 >, if the map named < id2 > is more detailed than the map named < id1 >, an output line of the form YES: < id2 > is a more detailed version of < id1 > must be written. In other case, the output must be of the form NO: < id2 > is not a more detailed version of < id1 >
範例輸入 1
COL1 Bogota Cali Bogota Barranquilla * * * COL2 Barranquilla Bogota Armenia Cali Barranquilla Armenia Bogota Cali Cali Barrranquilla * * * COL1 Bogota Cali Bogota Barranquilla * * * COL3 Bogota Armenia Armenia Cali Cali Medellin Medellin Barranquilla * * * END
範例輸出 1
YES: COL2 is a more detailed version of COL1 NO: COL3 is not a more detailed version of COL1
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.