import java.util.Scanner;
/**
* HJ81 字符串字符匹配 - 简单
*/
public class HJ081 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
String shortStr = sc.nextLine();
String longStr = sc.nextLine();
boolean res = isAllCharExist(shortStr, longStr);
System.out.println(res);
}
sc.close();
}
private static boolean isAllCharExist(String shortStr, String longStr) {
char[] chars = shortStr.toCharArray();
for (char ch : chars) {
if (!longStr.contains(String.valueOf(ch))) {
return false;
}
}
return true;
}
}