/** * author: boutarou * created: 02.08.2020 12:19:32 **/ #include using namespace std; #define rep(i,n) for(int i = 0; i < int(n); i++) using ll = long long; using P = pair; int main() { string s, t; cin >> s >> t; sort(s.begin(), s.end()); sort(t.begin(), t.end()); if (s == t ) cout << "YES" << endl; else cout << "NO" << endl; return 0; }