#include <bits/stdc++.h>
using namespace std;
int Mod = 1000000007;
int Prm = 29;
int Pow[200005];
int Inv[200005];
int bigmod(int n, int r, int m) {
  if (r == 0) return 1LL;
  int ret = bigmod(n, r / 2, m);
  ret = (ret * 1LL * ret) % m;
  if (r & 1) ret = (ret * 1LL * n) % m;
  return ret;
}
int Hash[26][200005];
vector<int> tmp;
vector<int> List1, List2;
int main() {
  Pow[0] = 1;
  for (int i = 1; i < 200005; i++) Pow[i] = (Pow[i - 1] * 1LL * Prm) % Mod;
  Inv[200005 - 1] = bigmod(Pow[200005 - 1], Mod - 2, Mod);
  for (int i = 200005 - 2; i >= 0; i--) Inv[i] = (Inv[i + 1] * 1LL * Prm) % Mod;
  int n, q;
  scanf("%d %d", &n, &q);
  string s;
  cin >> s;
  for (int c = 0; c < 26; c++)
    for (int i = 1; i <= n; i++) {
      int now = (s[i - 1] == 'a' + c) ? Pow[i] : 0;
      Hash[c][i] = Hash[c][i - 1] + now;
      if (Hash[c][i] >= Mod) Hash[c][i] -= Mod;
    }
  while (q--) {
    int x, y, l;
    scanf("%d %d %d", &x, &y, &l);
    List1.clear();
    List2.clear();
    for (int c = 0; c < 26; c++) {
      int now = Hash[c][x + l - 1] - Hash[c][x - 1];
      if (now < 0) now += Mod;
      now = (now * 1LL * Inv[x - 1]) % Mod;
      List1.push_back(now);
    }
    for (int c = 0; c < 26; c++) {
      int now = Hash[c][y + l - 1] - Hash[c][y - 1];
      if (now < 0) now += Mod;
      now = (now * 1LL * Inv[y - 1]) % Mod;
      List2.push_back(now);
    }
    sort(List1.begin(), List1.end());
    sort(List2.begin(), List2.end());
    bool ok = true;
    for (int i = 0; i < 26; i++)
      if (List1[i] != List2[i]) ok = false;
    if (ok)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
