public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String str1 = sc.next();
            String str2 = sc.next();
            boolean res = getRes(str1,str2);
            System.out.println(res);
        }
    }

    private static boolean getRes(String str1, String str2) {
        Set<Character> set = new HashSet<>();
        for (int i = 0; i < str2.length(); i++) {
            set.add(str2.charAt(i));
        }
        int n1 = set.size();
        for (int i = 0; i < str1.length(); i++) {
            set.add(str1.charAt(i));
        }
        int n2 = set.size();
        if(n1 == n2){
            return true;
        }else{
            return false;
        }
    }
}