#include using ll = long long; using llu = long long unsigned; using namespace std; int main() { string A, B; cin >> A >> B; sort(A.begin(), A.end()); sort(B.begin(), B.end()); string ret = "NO"; if (A==B) { ret = "YES"; } cout << ret << endl; return 0; }