program abc103b
  implicit none
  character(100) s, t

  read *, s
  read *, t
  if (index(repeat(trim(s), 2), trim(t)) /= 0) then
     print '(a)', 'Yes'
  else
     print '(a)', 'No'
  end if
end program abc103b
