fun main() { val a = readln() val b = readln() if (a.toSortedSet() == b.toSortedSet()) println("YES") else println("NO") }