fun main(){println(if(readLine()!!.toCharArray().sorted()==readLine()!!.toCharArray().sorted())"YES" else "NO")}