fork download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main() {
  7. string a, b;
  8. cin >> a >> b;
  9. sort(a.begin(), a.end());
  10. sort(b.begin(), b.end());
  11. cout << (a == b ? "YES" : "NO");
  12. return 0;
  13. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
YES