import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    String s=scan.next();
    String p=scan.next();

    if(s.contains(p)){
      System.out.println("Yes");
    }else if(isSubString(s,p)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
  static boolean isSubString(String str1,String str2){

    for(int i=1;i<str2.length();i++){
      if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      }
    }

    return false;
  }
}
 import java.io.*; io.* java import java.util.*; util.* java import java.lang.*; lang.* java class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    String s=scan.next();
    String p=scan.next();

    if(s.contains(p)){
      System.out.println("Yes");
    }else if(isSubString(s,p)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
  static boolean isSubString(String str1,String str2){

    for(int i=1;i<str2.length();i++){
      if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      }
    }

    return false;
  }
} Main public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    String s=scan.next();
    String p=scan.next();

    if(s.contains(p)){
      System.out.println("Yes");
    }else if(isSubString(s,p)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  } main {
    Scanner scan=new Scanner(System.in);
    String s=scan.next();
    String p=scan.next();

    if(s.contains(p)){
      System.out.println("Yes");
    }else if(isSubString(s,p)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) String s=scan.next(); s scan.next() scan.next scan String p=scan.next(); p scan.next() scan.next scan if(s.contains(p)){
      System.out.println("Yes");
    }else if(isSubString(s,p)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    } s.contains(p) s.contains s p {
      System.out.println("Yes");
    } System.out.println("Yes") System.out.println System.out System System.out "Yes" if(isSubString(s,p)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    } isSubString(s,p) isSubString s p {
      System.out.println("Yes");
    } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
      System.out.println("No");
    } System.out.println("No") System.out.println System.out System System.out "No" String[] args args static boolean isSubString(String str1,String str2){

    for(int i=1;i<str2.length();i++){
      if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      }
    }

    return false;
  } isSubString {

    for(int i=1;i<str2.length();i++){
      if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      }
    }

    return false;
  } for(int i=1;i<str2.length();i++){
      if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      }
    } int i=1; int i=1; i 1 i<str2.length() i str2.length() str2.length str2 i++ i++ i {
      if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      }
    } {
      if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      }
    } if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      } str1.endsWith(str2.substring(0,i)) str1.endsWith str1 str2.substring(0,i) str2.substring str2 0 i {
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      } if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        } str1.startsWith(str2.substring(i,str2.length())) str1.startsWith str1 str2.substring(i,str2.length()) str2.substring str2 i str2.length() str2.length str2 {
          return true;
        } return true; true return false; false String str1 str1 String str2 str2
import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    String s=scan.next();
    String p=scan.next();

    if(s.contains(p)){
      System.out.println("Yes");
    }else if(isSubString(s,p)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
  static boolean isSubString(String str1,String str2){

    for(int i=1;i<str2.length();i++){
      if(str1.endsWith(str2.substring(0,i))){
        if(str1.startsWith(str2.substring(i,str2.length()))){
          return true;
        }
      }
    }

    return false;
  }
}

