output_description: If $p$ is in $s$, print Yes in a line, otherwise No.
input_description: In the first line, the text $s$ is given.  
  In the second line, the pattern $p$ is given.
attempt: from collections import deque
  
  
  def main():
      S = input()
      P = input()
  
      s = deque(S)
      n = len(S)
      for _ in range(n - 1):
          s.append(s.popleft())
          if P in "".join(s):
              ans = "Yes"
              break
      else:
          ans = "No"
  
      print(ans)
  
  
  main()
  
problem_description: Ring
  
    
  
  Write a program which finds a pattern $p$ in a ring shaped text $s$.
  
    
  ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ITP1_8_D)
samples: [{"input": "vanceknowledgetoad\n    advance", "output": "Yes"}, {"input": "vanceknowledgetoad\n    advanced", "output": "No"}]