function Main(a, b) {
	if(b.indexOf(a) !== -1) {
    	console.log("Yes");
    } else {
    console.log("No");
                    }
  	
}

const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');
Main(input[0].trim(), input[1].trim());