#include<bits/stdc++.h>
using namespace std;
map<char, int> Cnt;
int main() {
string origin, target;
cin >> origin >> target;
for(char ch: origin)
Cnt[ch]++;
for(char ch: target)
Cnt[ch]--;
int need = 0;
bool enough = true;
for(auto p: Cnt) {
if(p.second < 0) {
enough = false;
need += -p.second;
}
}
if(enough)
cout << "Yes " << origin.size() - target.size() << endl;
else
cout << "No " << need << endl;
return 0;
}