import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        String p = sc.next();

        int j = 0;

        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        }
        if(j == p.length())
            System.out.println("Yes");
        else
            System.out.println("No");

        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        String p = sc.next();

        int j = 0;

        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        }
        if(j == p.length())
            System.out.println("Yes");
        else
            System.out.println("No");

        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        String p = sc.next();

        int j = 0;

        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        }
        if(j == p.length())
            System.out.println("Yes");
        else
            System.out.println("No");

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        String p = sc.next();

        int j = 0;

        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        }
        if(j == p.length())
            System.out.println("Yes");
        else
            System.out.println("No");

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String p = sc.next(); p sc.next() sc.next sc int j = 0; j 0 for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 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)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        } {
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        } if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            } s.charAt(i) == p.charAt(0) s.charAt(i) s.charAt s i p.charAt(0) p.charAt p 0 {
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            } int a = i; a i j = 0 j 0 while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                } true {
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                } if(j == p.length())
                        break; j == p.length() j p.length() p.length p break; if(a + j == s.length())
                        a = -j; a + j == s.length() a + j a j s.length() s.length s a = -j a -j j if(s.charAt(a + j) != p.charAt(j))
                        break; s.charAt(a + j) != p.charAt(j) s.charAt(a + j) s.charAt s a + j a j p.charAt(j) p.charAt p j break; j++ j if(j == p.length())
                    break;
                else
                    j = 0; j == p.length() j p.length() p.length p break; j = 0 j 0 if(j == p.length())
            System.out.println("Yes");
        else
            System.out.println("No"); j == p.length() j p.length() p.length p 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" sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        String p = sc.next();

        int j = 0;

        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        }
        if(j == p.length())
            System.out.println("Yes");
        else
            System.out.println("No");

        sc.close();
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        String p = sc.next();

        int j = 0;

        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        }
        if(j == p.length())
            System.out.println("Yes");
        else
            System.out.println("No");

        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        String p = sc.next();

        int j = 0;

        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == p.charAt(0)){
                int a = i;
                j = 0;
                while(true){
                    if(j == p.length())
                        break;
                    if(a + j == s.length())
                        a = -j;
                    if(s.charAt(a + j) != p.charAt(j))
                        break;
                    j++;
                }
                if(j == p.length())
                    break;
                else
                    j = 0;
            }
        }
        if(j == p.length())
            System.out.println("Yes");
        else
            System.out.println("No");

        sc.close();
    }
}
