You are given strings S and T consisting of lowercase English letters.

You can perform the following operation on S any number of times:

Operation: Choose two distinct lowercase English letters c_1 and c_2, then replace every occurrence of c_1 with c_2, and every occurrence of c_2 with c_1.

Determine if S and T can be made equal by performing the operation zero or more times.

Constraints

* 1 \leq |S| \leq 2 \times 10^5
* |S| = |T|
* S and T consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:


S
T


Output

If S and T can be made equal, print `Yes`; otherwise, print `No`.

Examples

Input

azzel
apple


Output

Yes


Input

chokudai
redcoder


Output

No


Input

abcdefghijklmnopqrstuvwxyz
ibyhqfrekavclxjstdwgpzmonu


Output

Yes
import java.util.*;

class Main {
    private final String s, t;
    private final int sLength;
    private HashMap<Character, ArrayList<Integer> > sMap, tMap;
    private HashSet<ArrayList<Integer> > sIndexSet, tIndexSet;
    private static final String YES = "Yes", NO = "No";

    Main(String s, String t) {
        this.s = s;
        this.t = t;
        this.sLength = s.length();
    }

    private void mapValuesToSet(boolean is_s) {
        HashMap<Character, ArrayList<Integer> > strMap = is_s ? sMap : tMap;
        HashSet <ArrayList<Integer> > indexSet = new HashSet<>();

        for (ArrayList<Integer> arr : strMap.values()) {
            indexSet.add(arr);
        }

        if (is_s) {
            sIndexSet = indexSet;
        } else {
            tIndexSet = indexSet;
        }
    }

    private void mapIndexesToChar(boolean is_s) {
        String str = is_s ? this.s : this.t;
        HashMap<Character, ArrayList<Integer> > strMap = new HashMap<>();

        for (int i = 0; i < sLength; i++) {
            char c = str.charAt(i);
            if (strMap.get(c) == null) {
                ArrayList<Integer> arr = new ArrayList<>();
                arr.add(i);
                strMap.put(c, arr);
            } else {
                strMap.get(c).add(i);
            }
        }

        if (is_s) {
            sMap = strMap;
        } else {
            tMap = strMap;
        }
    }

    private void judge() {
        boolean is_s = true;
        boolean reached_last_check = true;

        mapIndexesToChar(is_s);
        mapIndexesToChar(!is_s);

        mapValuesToSet(is_s);
        mapValuesToSet(!is_s);

        for (ArrayList<Integer> arr : sIndexSet) {
            if (tIndexSet.contains(arr)) {
                tIndexSet.remove(arr);
            } else {
                reached_last_check = false;
                break;
            }
        }

        if (reached_last_check && this.tIndexSet.isEmpty()) {
            System.out.println(YES);
        } else {
            System.out.println(NO);
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String t = sc.nextLine();
        Main st = new Main(s, t);
        st.judge();
    }
}
