#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
string s0, s;
cin >> s0 >> s;
int cnt = 0;
for (int i = 0; i < s.size(); i++) {
int flag = 1;
for (int j = 0; j < s0.size(); j++) {
if (s[i] == s0[j]) {
s0[j] = '-';
flag = 0;
break;
}
}
if (flag) {
cnt++;
}
}
if (cnt) {
cout << "No " << cnt << endl;
}else{
cout << "Yes " << s0.size() - s.size() << endl;
}
return 0;
}