// editor4
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(){
    char str1[100], str2[100];
    int i;
    scanf("%s",str1);
    for ( i=0; str1[i]!='\0';i++){
        if(!isalpha(str1[i])){
            printf("Invalid input");
            return 0;
        }
    }
    if(strlen(str1)!=strlen(str2)){
        printf("NO");
        return 0;
    }
    for(i=0;str2[i]!='\0';i++){
        count1[tolower(str1[i])] - 'a']++;
        count2[tolower(str2[i])] - 'a']++;
    }
    for(i=0;i<26;i++){
        if(count1[i] != count2[i]){
            printf("NO");
            return 0;
        }
    }
    printf("YES");
    return 0;
}