program sample
    implicit none
    character(100) :: s,t,u
    integer(8) :: i,j,m,n
    real(8)::a,b
    integer(8),allocatable :: x(:),y(:)
    read(*,*) s
    read(*,*) t
    m=len_trim(s)
    n=0
    

    do i=1,m
        if(s .eq. t)then
            write(*,*)'Yes'
            stop
        end if
        do j=2,m
            u(j:j)=s(j-1:j-1)
        end do
        u(1:1)=s(m:m)
        do j=1,m
            s(j:j)=u(j:j)
        end do

    end do

    
 
    write(*,*) 'No'
 
    stop
end program sample
  

