#include <bits/stdc++.h>
using namespace std;
const long long hmod = 1791791791;
const long long hp = 179;
vector<long long> hppows = {1};
long long hppow(int i) {
  while ((int)hppows.size() < i + 1) {
    hppows.push_back((hppows.back() * hp) % hmod);
  }
  return hppows[i];
}
struct hashed_string {
  string s;
  vector<long long> h;
  hashed_string() {}
  hashed_string(string _s) {
    s = _s;
    h.resize(s.size() + 1);
    for (int i = 0; i < (int)s.size(); i++) {
      h[i + 1] = (h[i] * hp + (s[i] - 'a' + 1)) % hmod;
    }
  }
  long long substr_hash(int l, int r) {
    return ((((h[r] - h[l] * hppow(r - l)) % (hmod)) + (hmod)) % (hmod));
  }
};
int main() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  hashed_string hs[26];
  for (int c = 0; c < (26); c++) {
    string t;
    for (int i = 0; i < (n); i++) {
      t.push_back('a' + (s[i] - 'a' == c));
    }
    hs[c] = hashed_string(t);
  }
  for (int i = 0; i < m; i++) {
    int l, r, len;
    cin >> l >> r >> len;
    l--;
    r--;
    vector<long long> h1, h2;
    for (int c = 0; c < (26); c++) {
      h1.push_back(hs[c].substr_hash(l, l + len));
      h2.push_back(hs[c].substr_hash(r, r + len));
    }
    sort(h1.begin(), h1.end());
    sort(h2.begin(), h2.end());
    if (h1 == h2)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
