a=gets.split("").sort b=gets.split("").sort puts a==b ? "YES" : "NO"