#include <stdio.h>
#include <string.h>
#define N 300005
int n, m, i, j, k, a[N], b[N];
char s[N], t[N];
int main(){
scanf("%s%s", s+1, t+1);
n = strlen(s+1), m = strlen(t+1);
for(i=j=1; i<=n; a[i++]=1, j++){
if(s[i] == t[j]) ;
else if(s[i] == '?') ;
else if(t[j] == '?') ;
else break;
}//前面至多匹配到哪
for(i=n, j=m; i>=1; b[i--]=1, j--){
if(s[i] == t[j]) ;
else if(s[i] == '?') ;
else if(t[j] == '?') ;
else break;
}//后面至多匹配到哪
a[0] = b[n+1] = 1;
for(i=0; i<=m; i++){
j = m - i;
if(a[i] && b[n-j+1]) printf("Yes\n");
else printf("No\n");
}//前i个能匹配,后m-i也能匹配就行
return 0;
}