include[HTML_REMOVED]
using namespace std;
typedef unsigned long long ULL;
const int N = 1000010;
ULL h[N],p[N];
char s[N];
int m;
int P = 13331;
ULL get(int l,int r){
return h[r]-h[l-1]p[r-l+1];
}
int main(){
int l1,r1,l2,r2;
cin>>s>>m;
p[0] = 1;
for(int i = 1; i <= N+1 ; i ++ ){
h[i] = h[i-1]P + s[i-1];
p[i] = p[i-1]*P;
}
while(m–){
cin>>l1>>r1>>l2>>r2;
if(get(l1,r1)==get(l2,r2)) cout<<”Yes”<<endl;
else cout<<”No”<<endl;
}
}