#!/usr/local/gnu/bin/bash
read s
read t
for h in `seq 0 $((${#s}-1))`
do
    c1=${s:h:1}
    c2=${t:h:1}
    if [ $c1 != $c2 ]
    then s=`echo $s | tr $c1$c2 $c2$c1`
    fi
done
[ $s = $t ] && echo "Yes" || echo "No"
