import java.util.Scanner object no69{ def main(args:Array[String]):Unit={ val scan = new Scanner(System.in) val a,b = scan.next if(a.sorted == b.sorted) println("YES") else println("NO") } }