#include #include #include #include #include using namespace std; int main() { string a; string b; int n; int k; int f = 0; cin >> a >> b; n = a.size(); for (int i = 0; i <= n - 1; i++) { k = b.size(); for (int j = 0; j <= k - 1; j++) { if (a[i] == b[j]) { if (i == n - 1) { cout << "YES"; } b.erase(j); break; } else if (j == k -1) { cout << "NO"; f = 1; } } if (f == 1) { break; } } }