#include #include #include //#include using namespace std; string rollstr(string _T) { char tmp_c = _T[_T.length() - 1]; for (int i = _T.length()-1; i > 0; i--) { _T[i] = _T[i-1]; } _T[0] = tmp_c; return _T; } int main() { string S, T; cin >> S >> T; bool flag = false; for (int i = 0; i <= S.length(); i++) { if (S == T) { flag = true; break; } T=rollstr(T); } if (flag)cout << "Yes" << endl; else cout << "No" << endl; //Sleep(30000); return 0; }