#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
const ull B = 1777771;
ull S[100010],PB[100010]={1};
int n;
string str;


ull get(int l,int r){return S[r]-S[l]*PB[r-l];}
ull get(int l,int r,int x,char ch){
  ull res=get(l,r);
  if(x<l||r<=x) return res;
  return res+ch*PB[r-x-1]-str[x]*PB[r-x-1];
}

int search(int a,int b,int x,int ch){
  int L=0,M,R=1e5+1;
  while(L<R){
    M = (L+R)/2;
    if(max(a,b)+M>n||get(a,a+M,x,ch)!=get(b,b+M,x,ch)) R = M;
    else L = M+1;
  }
  return L-1;
}


bool check(int l,int r,int t){
  int x =l+t+search(l,l+t,-1,0);
  char ch=str[l+(x-l-t)%t];
  int a=get(l,r-t,l+(x-l-t)%t,str[x])==get(l+t,r,l+(x-l-t)%t,str[x]);
  return a||get(l,r-t,x,ch)==get(l+t,r,x,ch);
}

int main(){
  cin>>str;
  n = str.size();
  for(int i=0;i<n;i++) S[i+1]=S[i]*B+str[i];
  for(int i=1;i<n;i++) PB[i]=PB[i-1]*B;
  
  int q;
  cin>>q;
  while(q--){
    int l,r,t;
    cin>>l>>r>>t;
    cout<<(check(l-1,r,t)? "Yes":"No")<<endl;
  }
  return 0;
}