//strstr(a, b)在a中寻找相同序列的字串,存在返回指针,否则返回Null
//strstr(a, b)-a+1表示第几位出现相同序列
#include<iostream>
#define Max 100005
using namespace std;
char a[100002], b[100002], c[200004];
int main()
{
while(gets(a) != NULL)
{
strcpy(c, a);
strcat(c, a);
gets(b);
if(strstr(c, b))
printf("yes\n");
else
printf("no\n");
}
return 0;
}