output_description: If S equals T after _rotation_ , print `Yes`; if it does not, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
      T
attempt: #!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  """
  Created on Mon Feb 11 05:38:56 2019
  
  @author: shinjisu
  """
  
  
  # ABC 200点問題
  import math
  
  
  def getInt():
      return int(input())
  
  
  def getIntList():
      return [int(x) for x in input().split()]
  
  
  def zeros(n):
      return [0] * n
  
  
  def dmp(x):
      global debug
      if debug:
          print(x)
  
  
  debug = True
  
  
  def getIntLines(n):
      return [int(input()) for i in range(n)]
  
  
  def getIntMat(n):
      mat = []
      for i in range(n):
          mat.append(getIntList())
      return mat
  
  
  def zeros2(n, m):
      return [zeros(m)] * n
  
  
  def prob096():  # Maximum Sum
      X = getIntList()
      K = getInt()
      dmp((X, K))
      total = sum(X) - max(X) + max(X) * 2**K
      return total
  
  
  def prob097():  # Exponential
      X = getInt()
      dmp(X)
      if X == 1:
          return 1
      for n in range(X, 0, -1):
          dmp(n)
          for b in range(2, int(math.sqrt(X)) + 1):
              a = n
              exp = True
              while a > 1:
                  if a % b != 0:
                      exp = False
                      break
                  a //= b
              if exp:
                  break
          if exp:
              break
      return n
  
  
  def prob098():  # Cut and Count
      N = getInt()
      S = input()
      dmp((N, S))
      maxChCount = 0
      for i in range(1, N):
          before = S[:i]
          after = S[i:]
          dmp((before, after))
          chCount = 0
          for j in range(26):
              ch = chr(ord("a") + j)
              if ch in before and ch in after:
                  chCount += 1
          maxChCount = max(maxChCount, chCount)
      return maxChCount
  
  
  def prob099():  # Stone Momument
      a, b = getIntList()
      height = 0
      for i in range(b - a + 1):
          height += i
      height -= b
      return height
  
  
  def prob103():  # String Rotation
      S = input()
      T = input()
      for i in range(len(S)):
          S = S[1:] + S[0]
          dmp(S)
          if S == T:
              return "Yes"
      else:
          return "No"
  
  
  def prob000():  #
      return 0
  
  
  debug = False  # True False
  print(prob103())
  
problem_description: Statement
  
  You are given string S and T consisting of lowercase English letters.
  
  Determine if S equals T after _rotation_.
  
  That is, determine if S equals T after the following operation is performed
  some number of times:
  
  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ...
  S_{|S|-1}.
  
  Here, |X| denotes the length of the string X.
samples: [{"input": "kyoto\n    tokyo", "output": "Yes\n    \n\n  * In the first operation, `kyoto` becomes `okyot`.\n  * In the second operation, `okyot` becomes `tokyo`.\n\n* * *"}, {"input": "abc\n    arc", "output": "No\n    \n\n`abc` does not equal `arc` after any number of operations.\n\n* * *"}, {"input": "aaaaaaaaaaaaaaab\n    aaaaaaaaaaaaaaab", "output": "Yes"}]