#include #include int main() { using namespace std; string A, B; cin >> A >> B; sort(A.begin(), A.end()); sort(B.begin(), B.end()); cout << (A == B ? "YES" : "NO") << endl; return 0; }