#include #include using namespace std; int main() { string a, b; cin >> a >> b; sort(a.begin(), a.end()); sort(b.begin(), b.end()); cout << (a == b ? "YES\n" : "NO\n"); }