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