fun main(){ val a = readLine()!!.toCharArray().toList() val b = readLine()!!.toCharArray().toList() println(if (a.sorted().equals(b.sorted())) "YES" else "NO") }