#include #define rep(i, n) for(long long i = 0; i < (long long)n; i++) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int main() { string s, t; cin >> s >> t; sort(ALL(s)); sort(ALL(t)); cout << (s == t ? "YES" : "NO") << endl; }