#include<fstream.h>
#include<string.h>


int main()
{
ifstream input("ancient.in");
ofstream output("ancient.out");

char *a=new char[101];
char *b=new char[101];
char *copya=new char[101];
char *copyb=new char[101];
int *dif=new int[101];

input>>a>>b;

int i,j;
int len=strlen(a);
bool con=true;


for(i=0;i<=len;i++)copya[i]=a[i];
for(i=0;i<=len;i++)copyb[i]=b[i];


int *amount1=new int[26];
int *amount2=new int[26];

for(i=0;i<26;i++)amount1[i]=0;
for(i=0;i<26;i++)amount2[i]=0;


for(i=0;i<len;i++)amount1[copya[i]-'A']++;
for(i=0;i<len;i++)amount2[copyb[i]-'A']++;

for(i=0;i<26;i++){

	if(amount1[i]==0)continue;

	con=false;
	
	for(j=0;j<26;j++)if(amount2[j]==amount1[i]){con=true; amount2[j]=0; break;}

	if(!con)break;
}


if(!con)output<<"NO\n";
else output<<"YES\n";

return 0;
}





