program main
  implicit none

  character(len=100) :: s, t, s2
  integer :: i, n, l

  read(*,*) s, t

  n = len_trim(s)

  do i = 1, n
     s2 = s(i:n)//s(1:i-1)
     if(t == s2) then
        write(*,*) 'Yes'
        stop
     end if

  end do

  write(*,*) 'No'

end program main

  

  
