#include<stdio.h>
#include<string.h>
main()
{
char a[100000],b[100000],c[100000];
while(gets(a))
{
gets(b);
strcpy(c,a);
strcat(c,a);
if(strstr(c,b)!=NULL)
printf("yes\n");
else printf("no\n");
}
}
#include<stdio.h>
#include<string.h>
main()
{
char a[100000],b[100000],c[100000];
while(gets(a))
{
gets(b);
strcpy(c,a);
strcat(c,a);
if(strstr(c,b)!=NULL)
printf("yes\n");
else printf("no\n");
}
}