import scala.math._ object Main { def main(args: Array[String]) { val sc = new java.util.Scanner(System.in) val s, t = sc.nextLine if (s.sorted == t.sorted) println("YES") else println("NO") } }