123456789101112131415
#include <iostream> #include <string> #include <algorithm> int main() { std::string s, t; std::cin >> s >> t; std::sort(s.begin(), s.end()); if (s == t) std::cout << "YES\n"; else std::cout << "NO\n"; }
zfghs shgfz NO zfghs fghsz YES