#include #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ string a, b; cin >> a >> b; int m = 0; sort(a.begin(), a.end()); sort(b.begin(), b.end()); if(a == b){ cout << "YES" << endl; }else{ cout << "NO" << endl; } return 0; }