#include<stdio.h>
#include<ctype.h>
int main(){
    char str1[100], str2[100];
    scanf("%s %s", str1, str2);
    if(strlen(str1, str2)){
        printf("NO\n");
        return 0;
    }
    int count[256] = {0}    
    for(int i = 0; str1[i]; i++){
        count[tolower(str1[i])]++;
        count[tolower(str2[i])]--;
    }
    for(int i = 0; i < 256; i++){
        if(count[i] != 0){
            printf("NO\n");
            return 0;
        }
    }
    printf("YES\n");
    return 0;
}