module Main where
import List
import Monad

main = do
    [s1, s2, t1, t2] <- (liftM words . readFile) "enchanted.in"
    let result = sort (s1 `zip` reverse s2) == sort (t1 `zip` reverse t2)
    writeFile "enchanted.out" (if result then "Yes" else "No")
