Shuffle the letters

Given two words, we would like to know if one can be produced (without extra letters) as a result of shuffling the letters of the second one.
The input contains two space-separated words.
The program should print Yes if it’s possible to obtain the first word by shuffling the letters of the second one and No otherwise.
Input
Output
hello elloh
Yes
something some
No
some something
No
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue