
#include<bits/stdc++.h>
#include<iostream>
#include<string.h>
using namespace  std;
int main(){


   string s1,s2;
   cin>>s1;
   cin>>s2;

int l=s2.size();
char m=s2.at(l-1);


//char ch = s2[s2.size()-1];
//strcat(s1, s2[s2.size()-1]);

s1.append(1,m);
cout<<s1<<endl;

if(s1!=s2){
cout<<"No"<<endl;
}
else{
cout<<"Yes"<<endl;
}
}

