#abc287d. [abc287_d]Match or Not
[abc287_d]Match or Not
Problem Statement
You are given strings and consisting of lowercase English letters and ?
. Here, holds (for a string , denotes the length of ).
Two strings and such that is said to match if and only if:
- one can make equal by replacing each
?
in and with any English letter independently.
Solve the following problem for each :
- Let be the string of length obtained by concatenating the first characters and the last characters of without changing the order. Print
Yes
if and match, andNo
otherwise.
Constraints
- and are strings consisting of lowercase English letters and
?
.
Input
The input is given from Standard Input in the following format:
Output
Print lines.
The -th line should contain the answer for .
Sample Input 1
a?c
b?
Sample Output 1
Yes
No
No
When , equals ?c
. Here, we can replace the -st character of , ?
, with b
and the -nd character of , ?
, with c
to make equal , so and match. Thus, Yes
should be printed in the first line.
When and , respectively, is ac
and a?
, neither of which matches with . Thus, No
should be printed in the second and third lines.
Sample Input 2
atcoder
?????
Sample Output 2
Yes
Yes
Yes
Yes
Yes
Yes
Sample Input 3
beginner
contest
Sample Output 3
No
No
No
No
No
No
No
No