#include <bits/stdc++.h>
using namespace std;
string a,b;
void replaceSubstring(string& a, const string& b) {
size_t pos=0;
while((pos=a.find(b,pos))!=string::npos) {
a.replace(pos,b.length(),"ABC");
pos+=3;
}
}
int main()
{
cin>>a>>b;
if(a.find(b)!=string::npos){
cout<<"YES"<<endl;
replaceSubstring(a,b);
cout<<a;
}else{
cout<<"NO"<<endl;
cout<<a;
}
return 0;
}