#include #include #include #include #include #include #include #include using namespace std; int main(void){ string A, B; cin >> A >> B; sort(A.begin(), A.end()); sort(B.begin(), B.end()); for(int i = 0; i < A.size(); i++){ if(A[i] == B[i]){ if(i == A.size() - 1){ cout << "YES" << endl; break; } continue; }else{ cout << "NO" << endl; break; } } return 0; }