#include<iostream>
#include<map>

using namespace std;

int main(){
   
	map<char,int> shop;
	string s,e;
	cin>>s>>e;
	for(int i=0;i<s.length();i++) 
	shop[s[i]]++;
	int extra=0,miss=0;
	for(int i=0;i<e.length();i++){
   
		if(shop.find(e[i])!=shop.end()&&shop[e[i]]>0)
		shop[e[i]]--;
		else
		miss++;
	}	
	if(!miss){
   
		printf("Yes %d",s.length()-e.length());
	}
	else printf("No %d",miss);
	return 0;
}