#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif

#define size(v) v.size()

template <class S> vector<int> build_sa(const S& s) {
  int n = size(s);
  vector<int> sa(n), id(begin(s), end(s)), buf(n);
  iota(rbegin(sa), rend(sa), 0);
  stable_sort(begin(sa), end(sa), [&](int i, int j) { return s[i] < s[j]; });
  for (int m = 1; m < n; m *= 2) {
    for (int k = 0; k < n; ++k) {
      int i = sa[k], p = k ? sa[k - 1] : n, j = i + m / 2, q = p + m / 2;
      buf[i] = p + m < n and id[i] == id[p] and id[j] == id[q] ? buf[p] : k;
    }
    swap(id, buf);
    iota(begin(buf), end(buf), 0);
    auto nsa = sa;
    for (int k = 0, i; k < n; ++k)
      if ((i = sa[k] - m) >= 0) nsa[buf[id[i]]++] = i;
    swap(sa, nsa);
  }
  return sa;
}

template <class T> struct sparse_table {
  vector<vector<T>> t;
  sparse_table(const vector<T>& v = {}) : t{v} {
    for (int k = 1, n = size(v); 1 << k <= n; ++k) {
      t.emplace_back(n - (1 << k) + 1);
      for (int i = 0; i + (1 << k) <= n; ++i)
        t[k][i] = min(t[k - 1][i], t[k - 1][i + (1 << (k - 1))]);
    }
  }
  T fold(int l, int r) const {
    assert(l < r);
    int k = __lg(r - l);
    return min(t[k][l], t[k][r - (1 << k)]);
  }
};

template <class S> struct suffix_array {
  S s;
  int n;
  vector<int> sa, rank, h;
  sparse_table<int> st;
  suffix_array(const S& _s = S()) : s(_s), n(size(s)), rank(n), h(n) {
    sa = build_sa(s);
    for (int k = 0; k < n; ++k) rank[sa[k]] = k;
    for (int i = 0, m = 0; i < n; ++i, m = max(m - 1, 0)) {
      int j = rank[i] + 1 < n ? sa[rank[i] + 1] : n;
      while (max(i, j) + m < n and s[i + m] == s[j + m]) ++m;
      h[rank[i]] = m;
    }
    st = {h};
  }
  int lcp(int i, int j) const {
    if (i == j) return n - i;
    if (rank[i] > rank[j]) swap(i, j);
    return st.fold(rank[i], rank[j]);
  }
  int cmp(int i, int j, int len) const {
    int m = lcp(i, j);
    return m < len ? s[i + m] - s[j + m] : 0;
  }
};

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = size(s);
  int q;
  cin >> q;
  struct query {
    int l, r, t;
  };
  vector<query> qs(q);
  for (auto&& e : qs) {
    cin >> e.l >> e.r >> e.t;
    --e.l;
  }
  vector<bool> res(q);
  for (int _ = 2; _--; ) {
    suffix_array<string> sa(s);
    for (int qi = 0; qi < q; ++qi) {
      int l = qs[qi].l;
      int r = qs[qi].r;
      int t = qs[qi].t;
      if (r - l <= t + 1) {
        res[qi] = true;
        continue;
      }
      int k = sa.lcp(l, l + t);
      int m = l + t + k + 1;
      if (m >= r) {
        res[qi] = true;
        continue;
      }
      if (r - m > t and m + t + sa.lcp(m, m + t) < r) {
        continue;
      }
      int x = (k + 1) % t;
      if (x == 0) {
        if (sa.cmp(l, m, min(t, r - m)) == 0) {
          res[qi] = true;
        }
      } else if (r - m <= t - x) {
        if (sa.cmp(l + x, m, r - m) == 0) {
          res[qi] = true;
        }
      } else {
        if (sa.cmp(l + x, m, t - x) == 0 and sa.cmp(l, m + (t - x), min(x, r - (m + (t - x)))) == 0) {
          res[qi] = true;
        }
      }
    }
    reverse(begin(s), end(s));
    for (auto&& e : qs) {
      tie(e.l, e.r) = make_pair(n - e.r, n - e.l);
    }
  }
  for (auto e : res) {
    cout << (e ? "Yes\n" : "No\n");
  }
}



Measured memory_bytes: 11776