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: import sys
  
  sys.setrecursionlimit(1 << 25)
  read = sys.stdin.readline
  ra = range
  enu = enumerate
  
  
  def mina(*argv, sub=1):
      return list(map(lambda x: x - sub, argv))
  
  
  # 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと
  
  
  def read_a_int():
      return int(read())
  
  
  def read_ints():
      return list(map(int, read().split()))
  
  
  def read_col(H):
      """H is number of rows
      A列、B列が与えられるようなとき
      ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合"""
      ret = []
      for _ in range(H):
          ret.append(list(map(int, read().split())))
      return tuple(map(list, zip(*ret)))
  
  
  def read_tuple(H):
      """H is number of rows"""
      ret = []
      for _ in range(H):
          ret.append(tuple(map(int, read().split())))
      return ret
  
  
  def read_matrix(H):
      """H is number of rows"""
      ret = []
      for _ in range(H):
          ret.append(list(map(int, read().split())))
      return ret
      # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため
  
  
  MOD = 10**9 + 7
  INF = 2**31  # 2147483648 > 10**9
  # default import
  from collections import defaultdict, Counter, deque
  from operator import itemgetter
  from itertools import product, permutations, combinations
  from bisect import bisect_left, bisect_right  # , insort_left, insort_right
  
  # https://atcoder.jp/contests/abc103/tasks/abc103_b
  S = input()
  T = input()
  S += S
  
  print("Yes" if S.count(T) else "No")
  
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"}]