#include <stdio.h>
#include <string.h>
#include <stdbool.h>

class Solution{

bool isAnagramImpl(const char *s, const char *t) {
    if (strlen(s) != strlen(t)) return false;

    int f[26] = {0};

    for (int i = 0; s[i] != '\0'; ++i) {
        f[s[i] - 'a']++;
    }

    for (int i = 0; t[i] != '\0'; ++i) {
        f[t[i] - 'a']--;
    }

    for (int i = 0; i < 26; ++i) {
        if (f[i] != 0) return false;
    }

    return true;
}
    
};

int main() {
    Solution sol;

    char s[100], t[100];
    scanf("%s %s", s, t);

    bool res = sol.isAnagram(s, t);
    printf("%s\n", res ? "true" : "false");

    return 0;
}