import std.algorithm;
import std.functional;
import std.range;
import std.ascii;
import std.array;
import std.container;
import std.conv;
import std.numeric;
import std.stdio;
import std.string;
import std.typecons;

void log(A...)(A arg) {
    stderr.writeln(arg);
}
int size(T)(in T s) {
    return cast(int)s.length;
}

long extgcd(long a, long b, ref long x, ref long y) {
    long g = a; x = 1; y = 0;
    if (b != 0) {
        g = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }
    return g;
}
long inverse(long mod, long v) {
    long x, y;
    if (extgcd(v, mod, x, y) == 1) return (x + mod) % mod;
    return 0;
}

const long P = 10000481L;
const long[] mods = [999999937L, 1000000123L, 1000000207L];
long[][] pow;
static this() {
    const int N = cast(int)1e5 + 5;
    pow = new long[][](mods.length, N + 1);
    foreach (k, mod; mods) {
        pow[k][0] = 1L;
        foreach (n; 0 .. N) {
            pow[k][n + 1] = pow[k][n] * P % mod;
        }
    }
}

class RollingHash {
    long[] H;
    long mod;
    long P;
    int mod_index;
    this(long P, long mod, int mod_index, in string s) { 
        this.mod = mod;
        this.mod_index = mod_index;
        this.P = P;
        auto N = s.length;
        this.H = new long[N + 1]; // H[k]: s[0]*P^(n-1) + s[1]*P^(n-2) + ... + s[n-1]*P^0
        foreach (int i, c; s) {
            H[i + 1] = (H[i] * P + cast(int)(c)) % mod;
        }
    }
    long hash(int l, int r) { // [l, r)
        return (H[r] - H[l] * pow[mod_index][r - l] % mod + mod) % mod;
    }
}

void main() {
    auto s = readln.chomp;
    int N = s.size;
    int Q = readln.chomp.to!int;

    auto P_exp = new bool[long][mods.length];
    foreach (k, mod; mods) {
        long p = 1;
        P_exp[k][p] = true;
        foreach (n; 0 .. N + 2) {
            p = (p * P) % mod;
            P_exp[k][p] = true;
        }
    }

    auto hashers = iota(0, mods.length, 1).map!((k) => new RollingHash(P, mods[k], cast(int)k, s)).array;

    auto inv_cache = new long[][](mods.length, 70);
    foreach (k, mod; mods) {
        foreach (q; -26 .. 26 + 1) {
            long y = q < 0 ? q + mod : q;
            inv_cache[k][q + 30] = inverse(mod, y);
        }
    }

    foreach (_; 0 .. Q) {
        //log(_);
        int l, r, t; 
        scanf("%d %d %d\n", &l, &r, &t);
        l--;

        auto k = (r - l) / t;
        auto m = r - l - t * k;
        //log([l, r, t, k, m]);

        auto ans = new bool[hashers.length];
        foreach (j, ref hasher; hashers) {
            auto mod = hasher.mod;
            assert(mod == mods[j]);
            long org = hasher.hash(l, r);
            auto inv = delegate long(long x) { return inverse(mod, x); };

            long cycle_hash(int z) {
                long a = hasher.hash(l + t * z, l + t * z + t);
                return (a * (pow[j][t * k] - 1L) % mod * inv(pow[j][t] - 1L) % mod * pow[j][m] % mod 
                        + hasher.hash(l + t*z, l + t*z + m)) % mod;
            }

            foreach (z; [0, 1]) {
                if (l + t * z + t > r) continue;
                auto diff = (org - cycle_hash(z) + mod) % mod;
                if (diff == 0) { ans[j] = true; }
                foreach (q; -26 .. 26 + 1) {
                    if (inv_cache[j][q + 30] * diff % mod in P_exp[j]) {
                        ans[j] = true;
                    }
                }
            }
        }
        writeln(ans.all ? "Yes" : "No");
    }
}