import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
char[] mchrs = scan.nextLine().toCharArray();
char[] schrs = scan.nextLine().toCharArray();
System.out.println(process(mchrs, schrs));
}
}
public static boolean process(char[] mchrs, char[] schrs) {
int[] nums = new int[26];
for (char chr : schrs) {
nums[chr - 'a']++;
}
for (char chr : mchrs) {
if (nums[chr - 'a'] == 0) {
return false;
}
}
return true;
}
}