#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 2e5 + 1;
constexpr int MAGIC = 4;
using ll = long long;
using Arr = array<int, MAGIC>;
int N, M, K;
string s;
int x[MAXN], y[MAXN], len[MAXN];
Arr MOD, BASE;
inline int norm(int a, const int& mod) {
  while (a >= mod) a -= mod;
  while (a < 0) a += mod;
  return a;
}
inline int mul(int a, int b, const int& mod) { return int(1LL * a * b % mod); }
inline Arr operator+(const Arr& a, const Arr& b) {
  Arr ret;
  for (int i = (int)0; i < (int)ret.size(); ++i) {
    ret[i] = norm(a[i] + b[i], MOD[i]);
  }
  return ret;
}
inline Arr operator-(const Arr& a, const Arr& b) {
  Arr ret;
  for (int i = (int)0; i < (int)ret.size(); ++i) {
    ret[i] = norm(a[i] - b[i], MOD[i]);
  }
  return ret;
}
inline Arr operator*(const Arr& a, const Arr& b) {
  Arr ret;
  for (int i = (int)0; i < (int)ret.size(); ++i) {
    ret[i] = mul(a[i], b[i], MOD[i]);
  }
  return ret;
}
int CMODS[] = {int(1e9) + 7,  int(1e9) + 9,  int(1e9) + 21, int(1e9) + 33,
               int(1e9) + 87, int(1e9) + 93, int(1e9) + 97, int(1e9) + 103};
int CBASE[] = {1009, 1013, 1019, 1021};
Arr pBase[MAXN];
Arr ph[27][MAXN];
vector<int> ord[MAXN];
void Init() {
  mt19937 rnd;
  unsigned int seed = N;
  for (int i = (int)0; i < (int)N; ++i) {
    seed = (seed * 3) + s[i];
  }
  for (int i = (int)0; i < (int)M; ++i) {
    seed = (seed * 3) + x[i];
    seed = (seed * 3) + y[i];
    seed = (seed * 3) + len[i];
  }
  rnd.seed(seed);
  set<int> mids;
  while (mids.size() < MOD.size()) {
    mids.emplace(rnd() % 8);
  }
  vector<int> vmids(mids.begin(), mids.end());
  for (int i = (int)0; i < (int)MOD.size(); ++i) {
    MOD[i] = CMODS[vmids[i]];
    BASE[i] = CBASE[i];
  }
  pBase[0] = {1, 1, 1, 1};
  for (int i = (int)1; i < (int)MAXN; ++i) {
    pBase[i] = pBase[i - 1] * BASE;
  }
  for (int c = (int)0; c < (int)26; ++c) {
    ph[c][0] = {0, 0};
    for (int i = (int)0; i < (int)N; ++i) {
      int val = (s[i] - 'a' == c);
      ph[c][i + 1] = ph[c][i] * BASE + Arr{val, val};
    }
  }
  vector<int> cur_ord(26, 0);
  iota(cur_ord.begin(), cur_ord.end(), 0);
  for (int i = (int)N - 1; i >= (int)0; --i) {
    ord[i] = cur_ord;
    auto it = find(ord[i].begin(), ord[i].end(), int(s[i] - 'a'));
    ord[i].erase(it);
    ord[i].emplace(ord[i].begin(), int(s[i] - 'a'));
    cur_ord = ord[i];
  }
}
Arr GetHash(int id, int l, int r) {
  return ph[id][r] - ph[id][l] * pBase[r - l];
}
void Solution() {
  Init();
  for (int q = (int)0; q < (int)M; ++q) {
    int s1 = x[q], s2 = y[q];
    bool ok = true;
    for (int i = (int)0; i < (int)26; ++i) {
      if (GetHash(ord[s1][i], s1, s1 + len[q]) !=
          GetHash(ord[s2][i], s2, s2 + len[q])) {
        ok = false;
        break;
      }
    }
    cout << (ok ? "YES" : "NO") << '\n';
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  while (cin >> N >> M) {
    cin >> s;
    for (int i = 0; i < M; ++i) {
      cin >> x[i] >> y[i] >> len[i];
      --x[i], --y[i];
    }
    Solution();
  }
  return 0;
}
