#include <bits/stdc++.h>
#define ull unsigned long long
using namespace std;
//const ll P=1e9+7;
const ull base=131; //挺好用的一个hash base
const int N=1e6+10;
int m;
ull sum[N],powe[N];
char s[N];
int main()
{
scanf( "%s",s+1 );
powe[0]=1; int len=strlen(s+1);
for ( int i=1; i<=len; i++ )
{
//sum[i]=(sum[i-1]*base+(s[i]-'a'+1))%P;
sum[i]=(sum[i-1]*base+(s[i]-'a'+1)); //字符串hash前缀和
powe[i]=powe[i-1]*base; //其实可以把字符串hash理解为base进制数
//powe[i]=powe[i-1]*base%P;
}
scanf( "%d",&m );
while ( m-- )
{
int l1,l2,r1,r2; scanf( "%d%d%d%d",&l1,&r1,&l2,&r2 );
//ll res1=sum[r1]-sum[l1-1]*powe[r1-l1+1]%P;
ull res1=sum[r1]-sum[l1-1]*powe[r1-l1+1];
ull res2=sum[r2]-sum[l2-1]*powe[r2-l2+1];
//ll res2=sum[r2]-sum[l2-1]*powe[r2-l2+1]%P;
if ( res1==res2 ) printf( "Yes\n" );
else printf( "No\n" );
}
}