#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 5, delta = 1e9 + 7, base = 613;
vector<string> letters;
long long hashed[27][maxn], pwr[maxn];
string s;
int n, q;
void power_calc() {
  pwr[0] = 1;
  for (int i = 1; i < maxn; i++) pwr[i] = (pwr[i - 1] * base) % delta;
}
void prestet_l() {
  string tmp;
  for (int i = 0; i < n + 1; i++) tmp += '0';
  for (int i = 0; i < 26; i++) letters.push_back(tmp);
}
void set_prehash() {
  for (int i = 0; i < n; i++) letters[s[i] - 'a'][i] = '1';
}
void set_hash() {
  for (int i = 0; i < 26; i++) {
    hashed[i][0] = 0;
    for (int j = 1; j <= n; j++)
      hashed[i][j] =
          (hashed[i][j - 1] * base) % delta + (letters[i][j - 1] - '0');
  }
}
long long tell_hash(int l, int r, int i) {
  r++;
  return (hashed[i][r] - ((hashed[i][l] * pwr[r - l]) % delta) + delta) % delta;
}
bool are_same(int l1, int r1, int l2, int r2) {
  vector<int> a1, a2;
  for (int i = 0; i < 26; i++) {
    a1.push_back(tell_hash(l1, r1, i));
    a2.push_back(tell_hash(l2, r2, i));
  }
  sort(a1.begin(), a1.end());
  sort(a2.begin(), a2.end());
  for (int i = 0; i < 26; i++)
    if (a1[i] != a2[i]) return 0;
  return 1;
}
void input() { cin >> n >> q >> s; }
void ans_q() {
  while (q--) {
    int p1, p2, l;
    cin >> p1 >> p2 >> l;
    p1--;
    p2--;
    l--;
    if (are_same(p1, p1 + l, p2, p2 + l))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
void test() {
  while (1) {
    int l, r, i;
    cin >> l >> r >> i;
    cout << tell_hash(l, r, i) << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  power_calc();
  input();
  prestet_l();
  set_prehash();
  set_hash();
  ans_q();
}
