
Nathan is a competitor in the Canadian Computing Olympiad (CCO). To prepare for this difficult competition, he will bring a thick binder full of code samples (even though the CCO disallows paper notes).
Nathan begins by categorizing the pages according to the holes that appear. The rules are stated below:
- A category is a string with a length between
and . - The first letter of the string is
-
. - The possible hole locations on the page are labelled from
A
toF
. When a page has a hole, its corresponding letter is in the string. - The letters in the string will appear in sorted order.
For example, the category -ABF
represents a page with holes at A
, B
, and F
. The category -ABCDEF
represents a page with holes at all
Nathan's binder is slightly unusual. Since he has a massive number of pages, he needs certain holes in certain locations. The page template
Nathan will put
Input Specification
The first line contains
The second line contains
The next
Output Specification
For each of the yes
or no
on its own line. Print yes
if the page can fit into the binder. Print no
if additional holes need to be punched.
Sample Input
-ABC
4
-AB
-ABC
-ABCDEF
-DEF
Sample Output
no
yes
yes
no
Explanation for Sample Output
From the template A
, B
, and C
for a page to fit into a binder.
The first page is missing hole C
, so the output is no
.
The second and third pages have the necessary yes
.
The fourth page does not have any of the holes, so the output is no
.
Comments