#include<iostream>
#include <iomanip>
#include <cstdio>
#include<string>
#include<vector>
#include<array>
#include<math.h>
#include <ctype.h>
#include<algorithm>
using namespace std;
int main()
{
string a, b;
cin >> a >> b;
int c[130] = { 0 };
int d[130] = { 0 };
int i,x = 0,y = 0;
for (i = 0; i < a.length(); i++)
{
c[a[i]]++;
}
for (i = 0; i < b.length(); i++)
{
if (c[b[i]] > 0)
{
c[b[i]]--;
x++;
}
else
y++;
}
if (y > 0)
{
cout << "No" << " " << y;
}
else if (x > 0)
{
int q = a.length() - b.length();
cout << "Yes" << " " << abs(q);
}
return 0;
}