http://acm.hdu.edu.cn/showproblem.php?pid=2203
#include<iostream>
#include<string>
using namespace std;
int main(){
string a,b;
while(cin>>a>>b){
a=a+a+a;
if(a.find(b)!=string::npos)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}
return 0;
}