program main
     implicit none
     character*100 s,t
     integer i,a
     read(*,*)s
     read(*,*)t
     a=len_trim(s)
     do i=0,a
          if(i==0 .and. s(1:a)==t(1:a))then
               write(*,*)"Yes"
               goto 10
          endif
          
          if(i/=0 .and. s(i+1:a)==t(1:a-i).and. s(1:i)==t(a-i+1:a))then
               write(*,*)'Yes'
               goto 10
          endif
     enddo
     write(*,*)"No"
10 continue
end program main
