#include<stdio.h>
#include<string.h>

int main()
{
	char s1[10000], s2[10000];
	scanf("%s%s", s1, s2);
	int i = strlen(s1);
	int j = 0;
	for(;s2[j] != '\0'; j++)
    {
        s1[i+j] = s2[j];
    }
	strstr(s1, s2) != NULL ? printf("Yes\n") : printf("No\n");
	return 0;
}