import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        }catch(IOException e){
            e.printStackTrace();
        }
        
        
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        }catch(IOException e){
            e.printStackTrace();
        }
        
        
    }
} Main public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        }catch(IOException e){
            e.printStackTrace();
        }
        
        
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        }catch(IOException e){
            e.printStackTrace();
        }
        
        
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        }catch(IOException e){
            e.printStackTrace();
        } catch(IOException e){
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        } String s = br.readLine(); s br.readLine() br.readLine br StringBuilder sb = new StringBuilder(); sb new StringBuilder() char[] arr = s.toCharArray(); arr s.toCharArray() s.toCharArray s sb.append(s) sb.append sb s for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            } int i=0; int i=0; i 0 i<arr.length-1 i arr.length-1 arr.length arr arr.length 1 i++ i++ i {
                sb.append(arr[i]);
            } {
                sb.append(arr[i]);
            } sb.append(arr[i]) sb.append sb arr[i] arr i s = new String(sb) s new String(sb) String p = br.readLine(); p br.readLine() br.readLine br if(s.contains(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" {
                System.out.println("No");
            } System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        }catch(IOException e){
            e.printStackTrace();
        }
        
        
    }
} public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        }catch(IOException e){
            e.printStackTrace();
        }
        
        
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            String s = br.readLine();
            // String s = "vanceknowledgetoad";
            StringBuilder sb = new StringBuilder();
            char[] arr = s.toCharArray();
            
            sb.append(s);
            for(int i=0; i<arr.length-1; i++){
                sb.append(arr[i]);
            }
            
            s = new String(sb);
            
            String p = br.readLine(); 
            // String p = "advanced";
            if(s.contains(p)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }    
        }catch(IOException e){
            e.printStackTrace();
        }
        
        
    }
}
