#include using namespace std; using ll = long long; #define rep(i, s, e) for (int i = (int)s; i < (int)e; ++i) #define all(a) (a).begin(), (a).end() const ll mod = 1e9 + 7; int main() { cin.tie(nullptr); string A, B; cin >> A >> B; sort(all(A)); sort(all(B)); if (A == B) cout << "YES\n"; else cout << "NO\n"; }