#include using namespace std; void count(const string&s,vector&cnt){ for(auto&&i:s)++cnt.at(i-'a'); } int main(){ cin.tie(0),ios::sync_with_stdio(false); string a,b; cin>>a>>b; vectoraa(26,0),bb(26,0); count(a,aa); count(b,bb); cout<<(aa==bb?"YES"s:"NO"s)<<"\n"s; }