def check():

    S = eval(input())

    T = eval(input())

    S *= 2

    if T in S:

        return 'Yes'

    return 'No'

print((check()))
def check():

  S = eval(input())

  T = eval(input())

  S *= 2

  for i in range(len(T)):

    if S[i:i+len(T)]==T:

      return 'Yes'

  return 'No'

print((check()))
def check():
    S = eval(input())
    T = eval(input())
    S *= 2
    if T in S:
        return "Yes"
    return "No"


print((check()))

def check():
    S = eval(input())
    T = eval(input())
    S *= 2
    for i in range(len(T)):
        if S[i : i + len(T)] == T:
            return "Yes"
    return "No"


print((check()))

-    if T in S: -        return "Yes" +    for i in range(len(T)): +        if S[i : i + len(T)] == T: +            return "Yes"