// editor2
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(){
    char str1[20],str2[20];
    int c[26]={0};
    scanf("%s", str1);
    scanf("%s", str2);
    int l1=strlen(str1);
    int l2= strlen(str2);
    if(l1<1 || l1>10 \||l2<1 ||l2>10){
        printf("Invalid input\n");
        return 0;
    }
    for(int i=0;i<l1;i++){
        if(!isalpha(str1[i])){
            printf("Invalid input\n");
            return 0;
        }
        str1[i]=tolower(str1[i]);
    }
    for(int i=0;i<12;i++){
        if(!isalpha(str2[i])){
            printf("Invalid input\n");
            return 0;
            
        }
        str2[i]=tolower(str2[i]);
    }
    if(l1!=12){
        printf("NO\n");
        return 0;
    }
    for(int i=0;i<l1;i++){
        c[str1[i]='a'}++;
    }
    for(int i=0;i<l2;i++){
        c[str2[i]-'a']--;
    }
    for(int i=0;i<l2;i++){
        if(c[i]!==0){
            printf("NO\n");
            return 0;
        }
    }
    printf("YES\n");
    return 0;
}