#include<bits/stdc++.h>
using namespace std;
const int M = 1000000007;

class suffix_array {
    // compare (rank[i], rank[i + k]) and (rank[j], rank[j + k])
    static bool compare_sa(int n, const vector<int>& rank, int i, int j, int k) {
        if (rank[i] != rank[j]) return rank[i] < rank[j];
        int ri = i + k <= n ? rank[i + k] : -1;
        int rj = j + k <= n ? rank[j + k] : -1;
        return ri < rj;
    }
public:
    static vector<int> construct_sa(const string& s) {
        int n = s.length();
        vector<int> sa(n + 1), rank(n + 1);
        for (int i = 0; i <= n; ++i) {
            sa[i] = i;
            rank[i] = i < n ? s[i] : -1;
        }
        for (int k = 1; k <= n; k <<= 1) {
            sort(sa.begin(), sa.end(), [&n, &k, &rank](const int& a, const int& b){ return compare_sa(n, rank, a, b, k); });

            vector<int> tmp(n + 1);
            for (int i = 1; i <= n; ++i)
                tmp[sa[i]] = tmp[sa[i - 1]] + compare_sa(n, rank, sa[i - 1], sa[i], k);
            for (int i = 0; i <= n; ++i)
                rank[i] = tmp[i];
        }
        return sa;
    }
    static vector<int> construct_lcp(const string& s, const vector<int>& sa) {
        int n = s.length();
        vector<int> rank(n + 1), lcp(n + 1);
        for (int i = 0; i <= n; ++i) rank[sa[i]] = i;

        int h = 0;
        for (int i = 0; i < n; ++i) {
            if (h > 0) --h;
            for (int j = sa[rank[i] - 1]; j + h < n && i + h < n; ++h)
                if (s[j + h] != s[i + h]) break;

            lcp[rank[i] - 1] = h;
        }
        return lcp;
    }
};

class segtree {
private:
    int n, s, t;
    vector<int> tr;
    const int ex = M;

    int q(int k, int l, int r) {
        return r <= s || t <= l ? ex : s <= l && r <= t ? tr[k]
                : min(q(k << 1 | 1, l, (l + r) >> 1), q((k + 1) << 1, (l + r) >> 1, r));
    }

public:
    segtree(int m) {
        n = 1;
        while (n < m) n <<= 1;
        tr.clear();
        tr.resize((n << 1) - 1, ex);
    }
    void update(int j, const int& x) {
        int i = j + n - 1;
        tr[i] = x;
        while (i > 0) { i = (i - 1) >> 1; tr[i] = min(tr[i << 1 | 1], tr[(i + 1) << 1]); }
    }
    // [s, t)
    int run(int _s, int _t) { s = _s; t = _t; return q(0, 0, n); }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    string s;
    int q;
    cin >> s >> q;
    int n = s.length();
    vector<int> sa = suffix_array::construct_sa(s);
    vector<int> rank(n + 1);
    for (int i = 0; i <= n; ++i) rank[sa[i]] = i;
    vector<int> lcp = suffix_array::construct_lcp(s, sa);
    segtree sg(n + 1);
    for (int i = 0; i <= n; ++i) {
        sg.update(i, lcp[i]);
    }
    auto run = [&](const int& a, const int& b){ return sg.run(min(a, b), max(a, b)); };
    for (int _ = 0; _ < q; ++_) {
        int l, r, t;
        cin >> l >> r >> t;
        --l;
        int l1 = run(rank[l], rank[l + t]);
        if (l + t + l1 >= r) {
            cout << "Yes\n";
        }
        else {
            bool b1 = (l1 < t || s[l + l1 - t] == s[l + l1 + t]) && (l + l1 + t * 2 >= r || s[l + l1 + t] == s[l + l1 + t * 2]);
            bool b2 = l + l1 + t * 2 >= r || s[l + l1] == s[l + l1 + t * 2];
            int l2 = run(rank[l + l1 + 1], rank[l + l1 + 1 + t]);
            int l3 = l + l1 + 1 + t * 2 >= r ? 0 : run(rank[l + l1 + t + 1], rank[l + l1 + t * 2 + 1]);
            // cout << l2 << ' ' << l3 << '\n';
            if ((l2 == t - 1 || l + l1 + 1 + t + l2 >= r) && l + l1 + 1 + t * 2 + l3 >= r && (b1 || b2)) {
                cout << "Yes\n";
            }
            else
                cout << "No\n";
        }
    }


    return 0;
}



Measured memory_bytes: 5564