String 有个方法contains可以用来检测子串
import java.io.*;
import java.util.*;
public class test
{
public static void main(String[] args)
{
Scanner sin=new Scanner(System.in);
String str1=sin.next();
String str2=sin.next();
if(str2.contains(str1))
System.out.println("Yes");
else
System.out.println("No");
}
}