#include using namespace std; int main() { string A,B;cin>>A>>B; sort(A.begin(),A.end()); bool ans=false; do { if(A==B) { ans=true; break; } }while(next_permutation(A.begin(),A.end())); if(ans) { cout<<"YES"<