#include #include #include #include using namespace std; int main() { int p[26] = {}, q[26] = {}; string s, t; cin >> s >> t; for (int i = 0; i < static_cast(s.size()); i++) { p[static_cast(s[i] - 'a')]++; } for (int i = 0; i < static_cast(t.size()); i++) { q[static_cast(t[i] - 'a')]++; } for (int i = 0; i < 26; i++) { if (p[i] != q[i]) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }