import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main{
public static void main(String[] args) throws NumberFormatException, IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String str1=br.readLine();//店主给的珠子集合
String str2=br.readLine();//小红希望的珠子集合
// 0-9表示数字0-9的数目,17-42表A-Z的数目,49-74表a-z的数目
int[] count1=new int[75];//店主的各珠子数目
int[] count2=new int[75];//小红的各珠子数目
for(int i=0;i<str1.length();i++) {
int index=str1.charAt(i)-'0';
count1[index]++;
}
for(int i=0;i<str2.length();i++) {
int index=str2.charAt(i)-'0';
count2[index]++;
}
int num=0;//差的或者多出来的珠子数目
int type=0;//type=0则可以做出预想珠子,type=-1则不可以
// 遍历判断能不能做出预想珠子
for(int i=0;i<count2.length;i++) {
if(count2[i]!=0&&count1[i]<count2[i]) {
type=-1;
break;
}
}
// 遍历根据之前的type来获得Num
for(int i=0;i<count2.length;i++) {
if(type==0) {
if(count2[i]<count1[i]) {
num+=count1[i]-count2[i];
}
}
else {
if(count2[i]!=0&&count2[i]>count1[i]) {
num+=count2[i]-count1[i];
}
}
}
if(type==0) {
System.out.print("Yes "+num);
}else {
System.out.print("No "+num);
}
}
}