#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { string a,b; cin>>a>>b; vector cnta(26,0); vector cntb(26,0); for(char x : a){ int n=x-'a'; cnta.at(n)++; } for(char x : b){ int n=x-'a'; cntb.at(n)++; } if(cnta==cntb) cout<<"YES"<