import std.algorithm;
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 modPow(long mod)(long x, long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) return modPow!mod(x * x % mod, n / 2);
    return x * modPow!mod(x % mod, n - 1) % mod;
}

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;
}

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

const long P = 991;
const long mod = cast(long)1e9+7;
alias inv = inverse!mod;
alias pow = modPow!mod;
void main() {
    auto s = readln.chomp;
    int N = s.size;
    int Q = readln.chomp.to!int;

    bool[long] P_exp;
    long p = 1;
    P_exp[p] = true;
    foreach (n; 0 .. N + 1) {
        p = (p * P) % mod;
        P_exp[p] = true;
    }

    auto hasher = new RollingHash!([P], mod)(s);
    foreach (_; 0 .. Q) {
        int l, r, t; 
        scanf("%d %d %d\n", &l, &r, &t);
        l--;

        long org = hasher.hash(l, r)[0];

        auto k = (r - l) / t;
        auto m = r - l - t * k;

        long cycle_hash(long a) {
            return (a * (P.pow(t).pow(k) - 1) % mod * inv(P.pow(t) - 1) % mod * P.pow(m) % mod + hasher.hash(l, l + m)[0]) % mod;
        }

        auto as = [
            hasher.hash(l, l + t)[0]
        ];
        if (l + 2 * t <= r) {
            as ~= hasher.hash(l + t, l + 2*t)[0];
        }

        bool ans = false;
        foreach (a; as) {
            auto diff = (org - cycle_hash(a) + mod) % mod;
            //log([a, diff]);
            if (diff == 0) ans = true;
            foreach (q; -26 .. 26 + 1) {
                long y = q < 0 ? q + mod : q;
                if (y.inv * diff % mod in P_exp) {
                    ans = true;
                }
            }
        }
        writeln(ans ? "Yes" : "No");
    }
}