import java.util.Scanner;

class Main{
    
    public static void main(String[] args){
        
        Scanner sc =new Scanner(System.in);
        
        String S = sc.nextLine();
        String P = sc.nextLine();
        int count=0,k=0,flag=0;
        
        for(int i=0;i<S.length();i++) {
        	
	     if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     }
	     
        }
	     
	    if(flag==1) System.out.println("Yes");
	    else System.out.println("No");
	     
        }
        
        
} import java.util.Scanner; Scanner java.util class Main{
    
    public static void main(String[] args){
        
        Scanner sc =new Scanner(System.in);
        
        String S = sc.nextLine();
        String P = sc.nextLine();
        int count=0,k=0,flag=0;
        
        for(int i=0;i<S.length();i++) {
        	
	     if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     }
	     
        }
	     
	    if(flag==1) System.out.println("Yes");
	    else System.out.println("No");
	     
        }
        
        
} Main public static void main(String[] args){
        
        Scanner sc =new Scanner(System.in);
        
        String S = sc.nextLine();
        String P = sc.nextLine();
        int count=0,k=0,flag=0;
        
        for(int i=0;i<S.length();i++) {
        	
	     if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     }
	     
        }
	     
	    if(flag==1) System.out.println("Yes");
	    else System.out.println("No");
	     
        } main {
        
        Scanner sc =new Scanner(System.in);
        
        String S = sc.nextLine();
        String P = sc.nextLine();
        int count=0,k=0,flag=0;
        
        for(int i=0;i<S.length();i++) {
        	
	     if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     }
	     
        }
	     
	    if(flag==1) System.out.println("Yes");
	    else System.out.println("No");
	     
        } Scanner sc =new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc String P = sc.nextLine(); P sc.nextLine() sc.nextLine sc int count=0 count 0 k=0 k 0 flag=0; flag 0 for(int i=0;i<S.length();i++) {
        	
	     if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     }
	     
        } int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
        	
	     if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     }
	     
        } {
        	
	     if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     }
	     
        } if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     } S.charAt(i) == P.charAt(0) S.charAt(i) S.charAt S i P.charAt(0) P.charAt P 0 {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     } for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       } int j=i; int j=i; j i j<i+P.length() j i+P.length() i P.length() P.length P j++ j++ j {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       } {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       } if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; j<S.length() j S.length() S.length S if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0; S.charAt(j)==P.charAt(k) S.charAt(j) S.charAt S j P.charAt(k) P.charAt P k count++ count count+=0 count 0 if(S.charAt(j-S.length())==P.charAt(k)) count++; S.charAt(j-S.length())==P.charAt(k) S.charAt(j-S.length()) S.charAt S j-S.length() j S.length() S.length S P.charAt(k) P.charAt P k count++ count k++ k if(count==P.length()) flag=1; count==P.length() count P.length() P.length P flag=1 flag 1 count=0 count 0 k=0 k 0 if(flag==1) System.out.println("Yes");
	    else System.out.println("No"); flag==1 flag 1 System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String[] args args
import java.util.Scanner;

class Main{
    
    public static void main(String[] args){
        
        Scanner sc =new Scanner(System.in);
        
        String S = sc.nextLine();
        String P = sc.nextLine();
        int count=0,k=0,flag=0;
        
        for(int i=0;i<S.length();i++) {
        	
	     if(S.charAt(i) == P.charAt(0)) {
	    	 
	      for(int j=i;j<i+P.length();j++) {
	    	  
	       if(j<S.length())
		     if(S.charAt(j)==P.charAt(k)) count++;
		     else count+=0;
	       
		   else if(S.charAt(j-S.length())==P.charAt(k)) count++; 

	        k++;
	       }
	     
	      if(count==P.length()) flag=1;
	      
	      count=0;
	      k=0;
	     
	     }
	     
        }
	     
	    if(flag==1) System.out.println("Yes");
	    else System.out.println("No");
	     
        }
        
        
}
