#include <iostream> #include <string> #include <algorithm> using namespace std; int hash1[26]; int hash2[26]; int main() { string s1, s2; cin >> s1 >> s2; for(unsigned int i = 0; i < s1.size(); ++i) hash1[s1[i]-'A']++; for(unsigned int i = 0; i < s2.size(); ++i) hash2[s2[i]-'A']++; sort(hash1, hash1+26); sort(hash2, hash2+26); bool OverFlag = false; for(int i = 0; i < 26; ++i) if(hash1[i] != hash2[i]) { printf("NO/n"); OverFlag = true; break; } if(!OverFlag) printf("YES/n"); return 0; } //只要 s1 s2 的字符种类和各种类的个数相等即输出YES,else NO