s=gets.chop
p=gets.chop
def bubun(s,p)
    p.size.times do
        if s.include?(p)
            return true
        end
        s=s.split("").rotate.join
    end
    return false
end
if bubun(s,p)
    puts "Yes"
else
    puts "No"
end
