link
#include <string>
#include <iostream>
using namespace std;
int const MAXN = 100010;
int hashTable[MAXN] = { 0 };
int miss = 0;
int main() {
string s1, s2;
getline(cin, s1);
getline(cin, s2);
for (int i = 0; i < s1.length(); i++) {
hashTable[s1[i]]++;
}
for (int i = 0; i < s2.length(); i++) {
//if (hashTable[s1[i]] != 0) {
// hashTable[s1[i]]--;
//}
hashTable[s2[i]]--;
if (hashTable[s2[i]] < 0)
miss++;
}
if (miss == 0)
cout << "Yes " << s1.length() - s2.length();
else
cout << "No " << miss;
return 0;
}