#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) #define ALL(a) (a).begin(),(a).end() string a, b; signed main() { cin >> a >> b; sort(ALL(a)); sort(ALL(b)); cout << (a==b ? "YES" : "NO") << endl; return 0; }