Imports System
Module ABC103B
	Sub Main()
		Dim ans As String = "No"
		Dim s,s2,t As String
		s = Console.ReadLine()
		t = Console.ReadLine()
		Dim l As Integer = s.Length
		s2 = s
		Console.WriteLine(s2)
		For i As Integer = 0 To l-1
			Dim a as string = s2.SubString(l-1,1)
			Dim b as string = s2.SubString(0,l-1)
			s2 = a & b
			If s2 = t
				ans = "Yes"
				Exit For
			End If
		Next
		Console.WriteLine(ans)
	End Sub
End Module
