import java.util.Scanner;
import java.util.HashSet;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
HashSet<Character> set = new HashSet<>();
for (int i = 0; i < str.length(); i++) {
set.add(str.charAt(i));
}
String str1 = sc.nextLine();
HashSet<Character> set1 = new HashSet<>();
for (int i = 0; i < str1.length(); i++) {
set1.add(str1.charAt(i));
}
int count = 0;
for (Character c : set) {
if (set1.contains(c)) {
count++;
}
}
if (count == set.size()) {
System.out.println(true);
} else {
System.out.println(false);
}
}
}