#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define MAX 120
char s1[MAX],s2[MAX],c;
int i,p1[30],p2[30],l1,l2,j,o;
int main()
{freopen("ancient.in","r",stdin); 
freopen("ancient.out","w",stdout); 
scanf("%s",&s1); l1=strlen(s1); 
scanf("%s",&s2); l2=strlen(s2);

for (i=0;i<l1;i++) p1[toascii(s1[i])-65]++;
for (i=0;i<l2;i++) p2[toascii(s2[i])-65]++;

for (i=0;i<30;i++) 
{ o=0; j=0;if (p1[i]>0) 
while(j<30 && o==0){
	
if (p1[i]==p2[j]) 
{p1[i]=0; p2[j]=0; o=1;}
 j++;
}}

l1=0;
for (i=0;i<30;i++) l1+=p1[i];
l2=0;
for (i=0;i<30;i++) l2+=p2[i];


if (l1+l2==0) printf("YES");
else printf("NO");
fclose(stdin);fclose(stdout);
return 0;}