(print (if (equal? (sort (read-line)) (sort (read-line))) "YES" "NO"))