#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

const int MAX = 500000, MS = 2;
const long long mod[] = {999999937LL, 1000000007LL}, base = 9973;
struct rolling_hash {
    int n;
    vector<long long> hs[MS], pw[MS];
    rolling_hash(){}
    rolling_hash(const string &s) {
        n = s.size();
        for (int i = 0; i < MS; i++) {
            hs[i].assign(n+1,0);
            pw[i].assign(n+1,0);
            hs[i][0] = 0;
            pw[i][0] = 1;
            for (int j = 0; j < n; j++) {
                pw[i][j+1] = pw[i][j]*base%mod[i];
                hs[i][j+1] = (hs[i][j]*base+s[j])%mod[i];
            }
        }
    }

    long long hash(int l, int r, int i) { return ((hs[i][r]-hs[i][l]*pw[i][r-l])%mod[i]+mod[i])%mod[i]; }

    bool match(int l1, int r1, int l2, int r2) {
        bool ret = 1;
        for (int i = 0; i < MS; i++) ret &= hash(l1,r1,i)==hash(l2,r2,i);
        return ret;
    }

    bool match(int l, int r, long long h[]) {
        bool ret = 1;
        for (int i = 0; i < MS; i++) ret &= hash(l,r,i)==h[i];
        return ret;
    }
};


int main(){
    string s;
    cin >> s;
    int q;
    cin >> q;
    rolling_hash rh(s);
    for(int i=0;i<q;i++){
        int l,r,t;
        cin >> l >> r >> t;
        l--;r--;
        int l1,r1,l2,r2;
        l1 = l;
        l2 = l+t;
        r1 = r-t;
        r2 = r;
        if(rh.match(l1,r1,l2,r2)||(l+t==r+1)){
            cout << "Yes" << endl;
        }else{
            int ok = -1;
            int ng = r1-l1;
            while(ng-ok!=1){
                int mid = (ng+ok)/2;
                if(rh.match(l1,l1+mid,l2,l2+mid)){
                    ok = mid;
                }else{
                    ng = mid;
                }
            }
            bool flag = 0;
            if(l2>l1+ng-1){
                bool fflag = 1;
                for(int i=0;i<2;i++){
                    ll x = rh.hash(l1,r1+1,i);
                    ll y = rh.hash(l2,r2+1,i);
                    x = (x+(rh.pw[i][r1-l1-ng+1]*(mod[i]+s[l2+ng-1]-s[l1+ng-1])%mod[i]))%mod[i];
                    if(x!=y)fflag = 0;
                }
                if(fflag)flag = 1;
            }else{
                bool fflag = 1;
                for(int i=0;i<2;i++){
                    ll x = rh.hash(l1,r1+1,i);
                    ll y = rh.hash(l2,r2+1,i);
                    
                    x = (x+(rh.pw[i][r1-l1-ng+1]*(mod[i]+s[l2+ng-1]-s[l1+ng-1])%mod[i]))%mod[i];
                    y = (y+(rh.pw[i][r2-l1-ng+1]*(mod[i]+s[l2+ng-1]-s[l1+ng-1])%mod[i]))%mod[i];
                    
                    if(x!=y)fflag = 0;
                }

                if(fflag)flag = 1;
            }   
            if(l2+ng-1<=r1){

                bool fflag = 1;
                for(int i=0;i<2;i++){
                    ll x = rh.hash(l1,r1+1,i);
                    ll y = rh.hash(l2,r2+1,i);
                    x = (x+(rh.pw[i][r1-l2-ng+1]*(mod[i]+s[l1+ng-1]-s[l2+ng-1])%mod[i]))%mod[i];
                    y = (y+(rh.pw[i][r2-l2-ng+1]*(mod[i]+s[l1+ng-1]-s[l2+ng-1])%mod[i]))%mod[i];
                    if(x!=y)fflag = 0;
                }

                if(fflag)flag = 1;
            }else{
                bool fflag = 1;
                for(int i=0;i<2;i++){
                    ll x = rh.hash(l1,r1+1,i);
                    ll y = rh.hash(l2,r2+1,i);
                    y = (y+(rh.pw[i][r2-l2-ng+1]*(mod[i]+s[l1+ng-1]-s[l2+ng-1])%mod[i]))%mod[i];
                    if(x!=y)fflag = 0;    
                }

                if(fflag)flag = 1;
            } 
            if(flag){
                cout << "Yes" << endl;
            }else{
                cout << "No" << endl;
            }  
        }
    }

    return 0;
}


Measured memory_bytes: 6364