#include<stdio.h>
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
char a[101],b[101];
while(~scanf("%s",a))
{
int i,j,k;
int t=0,ok=0;
scanf("%s",b);
for(i=0; i<strlen(a); i++)
{
for(j=i,k=0; j<i+strlen(b),k<strlen(b); j++,k++)
{
if(a[j]==b[k])
{
t++;
}
}
if(t==strlen(b))
{
ok=1;
break;
}
else
{
t=0;
}
}
if(ok==0)
cout<<"NO"<<endl;
else if(ok==1)
cout<<"YES"<<endl;
}
}
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
char a[101],b[101];
while(~scanf("%s",a))
{
int i,j,k;
int t=0,ok=0;
scanf("%s",b);
for(i=0; i<strlen(a); i++)
{
for(j=i,k=0; j<i+strlen(b),k<strlen(b); j++,k++)
{
if(a[j]==b[k])
{
t++;
}
}
if(t==strlen(b))
{
ok=1;
break;
}
else
{
t=0;
}
}
if(ok==0)
cout<<"NO"<<endl;
else if(ok==1)
cout<<"YES"<<endl;
}
}