#include using namespace std; int main(){ string S, T; cin >> S >> T; sort(S.begin(), S.end()); sort(T.begin(), T.end()); cout << (S == T? "YES": "NO") << endl; }