#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); string s,t; cin >> s >> t; sort(s.begin(),s.end()); sort(t.begin(),t.end()); cout << (s==t?"YES":"NO") << endl; }