let str;
while(str = readline()){
  let sum = 0;
  let longStr = readline();
  let strArr = str.split('');
  for(let v of strArr){
    if(longStr.includes(v)){
      sum++;
    }
  }
  console.log(sum==strArr.length?true:false)
}