Some dwarves that are finishing the StUDY (State University for Dwarven Youngsters) Bachelor courses, have been told "no genome, no degree". That means that all dwarves should write a thesis on genome. Dwarven genome is far from simple. It is represented by a string that consists of lowercase Latin letters.

Dwarf Misha has already chosen the subject for his thesis: determining by two dwarven genomes, whether they belong to the same race. Two dwarves belong to the same race if we can swap two characters in the first dwarf's genome and get the second dwarf's genome as a result. Help Dwarf Misha and find out whether two gnomes belong to the same race or not.

Input

The first line contains the first dwarf's genome: a non-empty string, consisting of lowercase Latin letters.

The second line contains the second dwarf's genome: a non-empty string, consisting of lowercase Latin letters.

The number of letters in each genome doesn't exceed 105. It is guaranteed that the strings that correspond to the genomes are different. The given genomes may have different length.

Output

Print "YES", if the dwarves belong to the same race. Otherwise, print "NO".

Examples

Input

ab
ba


Output

YES


Input

aa
ab


Output

NO

Note

  * First example: you can simply swap two letters in string "ab". So we get "ba". 
  * Second example: we can't change string "aa" into string "ab", because "aa" does not contain letter "b". 
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Short.parseShort;
import static java.lang.Byte.parseByte;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Contest {

    static int nextInt() throws IOException {
        return parseInt(next());
    }

    static long nextLong() throws IOException {
        return parseLong(next());
    }

    static short nextShort() throws IOException {
        return parseShort(next());
    }

    static byte nextByte() throws IOException {
        return parseByte(next());
    }

    static String next() throws IOException {
        while (tok == null || !tok.hasMoreTokens())
            tok = new StringTokenizer(in.readLine());
        return tok.nextToken();
    }

    static String nextLine() throws IOException {
        return in.readLine();
    }

    private static BufferedReader in;
    private static StringTokenizer tok;
    private static PrintWriter out = new PrintWriter(System.out);
    private static Utilities doThis = new Utilities();

    public static void main(String[] args) throws Exception {
        in = new BufferedReader(new InputStreamReader(System.in));

        /*--------------------SolutionStarted-------------------*/
        solve();
        /*--------------------SolutionEnded--------------------*/

        in.close();
        out.close();
    }



    static void solve() throws IOException {
        char[] first = next().toCharArray(), second = next().toCharArray();
        int idx=0, idxes[]=new int[2];
        if (first.length!=second.length)
            no();
        for (int i = 0; i < first.length; i++) {
            if (first[i]!=second[i]){
                if (idx==2)
                    no();
                idxes[idx++]=i;
            }
        }
        swap(first,idxes[0],idxes[1]);
        if (equals(first[idxes[0]], second[idxes[0]])&&
                equals(first[idxes[1]], second[idxes[1]]) ){
            yes();
        }else no();
    }
    static boolean equals(char a, char b){
        return a==b;
    }
    static void swap(char[] s, int a,int b){
        char temp =s[b];
        s[b]= s[a];
        s[a] = temp;
    }
    static void yes(){
        out.println("YES");
        out.close();
        System.exit(0);
    }
    static void no() {
        out.println("NO");
        out.close();
        System.exit(0);
    }
}
class IntPair implements Comparable<IntPair> {
    int teamID, points;

    IntPair(int teamID, int points) {
        this.teamID = teamID;
        this.points = points;
    }

    @Override
    public int compareTo(IntPair o) {
        if (teamID == o.teamID)
            return 0;
        if (points == o.points)
            return o.teamID - teamID;
        return points - o.points;
    }

    public String toString() {
        return teamID + " " + points;
    }
}
class CharPair{
    char c;
    boolean flag;
    CharPair(char c, boolean flag){
        this.c = c;
        this.flag = flag;
    }
}
class BooleanPair {
    boolean key, value;

    BooleanPair() {
    }

    BooleanPair(boolean key, boolean value) {
        this.key = key;
        this.value = value;
    }
}
class Utilities {
    //int arrays start
    int lowerBound(int[] arr, int low, int high, int element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (element > arr[middle])
                low = middle + 1;
            else
                high = middle;
        }
        if (arr[low] < element)
            return -1;
        return low;
    }

    int upperBound(int[] arr, int low, int high, int element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (arr[middle] > element)
                high = middle;
            else
                low = middle + 1;
        }
        if (arr[low] <= element)
            return -1;
        return low;
    }
    //int arrays end
    //long arrays start
    int lowerBound(long[] arr, int low, int high, long element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (element > arr[middle])
                low = middle + 1;
            else
                high = middle;
        }
        if (arr[low] < element)
            return -1;
        return low;
    }

    int upperBound(long[] arr, int low, int high, long element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (arr[middle] > element)
                high = middle;
            else
                low = middle + 1;
        }
        if (arr[low] <= element)
            return -1;
        return low;
    }
    //long arrays end
    //double arrays start
    int lowerBound(double[] arr, int low, int high, double element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (element > arr[middle])
                low = middle + 1;
            else
                high = middle;
        }
        if (arr[low] < element)
            return -1;
        return low;
    }

    int upperBound(double[] arr, int low, int high, double element) {
        int middle;
        while (low < high) {
            middle = low + (high - low) / 2;
            if (arr[middle] > element)
                high = middle;
            else
                low = middle + 1;
        }
        if (arr[low] <= element)
            return -1;
        return low;
    }
    //double arrays end
}
/*int t = nextInt(), teamID , points, q, winner;
        TreeSet<IntPair> events;
        Map<Integer, Integer> teams;
        IntPair maxEvent = new IntPair(Integer.MIN_VALUE, Integer.MIN_VALUE), event;
        while(t-->0){
            winner = 0;
            teams = new HashMap<>(nextInt());
            events = new TreeSet<>();
            q = nextInt();
            for (int i = 1; i <= q ; i++) {
                teamID = nextInt();
                points = nextInt();
                if(teams.containsKey(teamID)){
                    events.remove(new IntPair(teamID,teams.get(teamID)));
                    points += teams.get(teamID);
                    teams.remove(teamID);
                    teams.put(teamID,points);
                    events.add(new IntPair(teamID, points));
                    event = events.last();
                    if (maxEvent.points<event.points){
                        if (maxEvent.teamID!=event.teamID) {
                            maxEvent = event;
                            winner = i;
                        }
                    }
                }else{
                    events.add(new IntPair(teamID, points));
                    teams.put(teamID, points);
                    event = events.last();
                    if (maxEvent.points<event.points){
                        if (maxEvent.teamID!=event.teamID) {
                            maxEvent = event;
                            winner = i;
                        }
                    }
                }
            }
            out.println(winner);
        }
        events = new TreeSet<>();
        teams = new HashMap<>();
        for (int i = 0; i < t; i++) {
            teamID = nextInt(); points = nextInt();
            if(teams.containsKey(teamID)) {
                event = new IntPair(teamID, teams.remove(teamID));
                events.remove(event);
                events.add(new IntPair(teamID, points));
            }else {
                teams.put(teamID,points);
                events.add(new IntPair(teamID, points));
            }
        }
        Iterator<IntPair> i = events.iterator();
        while (i.hasNext())
            out.println(i.next());*/