#include #define int long long #define double long double using namespace std; const int MOD = 1000000007; const int INF = 1e14; using Graph = vector>; signed main(){ string S, T; cin >> S >> T; map Scnt; map Tcnt; for( int i = 0; i < S.size(); i++ ) Scnt[S[i]]++; for( int i = 0; i < T.size(); i++ ) Tcnt[T[i]]++; for( char i = 'a'; i <= 'z'; i++ ){ if( Scnt[i] != Tcnt[i] ){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; }