#include<iostream>
#include<string>
using namespace std;
char m[128] = { 0 };
int main() {
string a, b;
cin >> a >> b;
for (int i = 0; i < a.size(); i++)
m[a[i]]++;
for (int i = 0; i < b.size(); i++)
m[b[i]]--;
int x = 0, y = 0;
for (int i = 0; i < 128; i++) {
if (m[i] > 0) x += m[i];
if (m[i] < 0) y += m[i];
}
if (y < 0)
cout << "No" << ' ' << -y << endl;
else
cout << "Yes" << ' ' << x << endl;
return 0;
}