#include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
int hashtable[150] = {0}, flag = 0, count = 0;
string s1, s2;
getline(cin, s1);
getline(cin, s2);
int length1 = s1.length();
int length2 = s2.length();
for (int i = 0; i < length1; i++)
{
hashtable[s1[i]]++;
}
for (int i = 0; i < length2; i++)
{
if (hashtable[s2[i]] > 0)
hashtable[s2[i]]--;
else if (hashtable[s2[i]] == 0)
{
flag = 1;
count++;
}
}
if (flag == 0)
{
cout << "Yes" << " "<<length1 - length2 << endl;
}
else
{
cout << "No" <<" "<< count << endl;
}
}