#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
const int HASH_CNT = 2;
int st[2][maxn], en[2][maxn], n, q, x, y, len;
char s[maxn];
struct Hasher {
  unsigned long long Seed, Mod;
  unsigned long long sum[26][maxn], bas[maxn];
  void init() {
    bas[0] = 1;
    for (int i = 1; i <= n; i++) {
      bas[i] = bas[i - 1] * Seed % Mod;
    }
    for (int i = 1; i <= n; i++)
      for (int j = 0; j < 26; j++)
        sum[j][i] = (sum[j][i - 1] * Seed % Mod + ((s[i] == j + 'a'))) % Mod;
  }
  inline unsigned long long getHash(unsigned long long *Sum, int l, int r) {
    return (Sum[r] - Sum[l - 1] * bas[r - l + 1] % Mod + Mod) % Mod;
  }
} gen[HASH_CNT];
void solve() {
  scanf("%d%d%d", &x, &y, &len);
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 26; j++) {
      st[i][j] = gen[i].getHash(gen[i].sum[j], x, x + len - 1),
      en[i][j] = gen[i].getHash(gen[i].sum[j], y, y + len - 1);
    }
    sort(st[i], st[i] + 26), sort(en[i], en[i] + 26);
  }
  for (int j = 0; j < 26; j++) {
    if (st[0][j] != en[0][j] || st[1][j] != en[1][j]) {
      printf("NO\n");
      return;
    }
  }
  printf("YES\n");
}
void input() {
  scanf("%d%d", &n, &q);
  scanf("%s", s + 1);
}
void hash_init() {
  gen[0].Seed = 146527, gen[0].Mod = 1e9 + 9;
  gen[1].Seed = 19260817, gen[1].Mod = 998244353;
  for (int i = 0; i < HASH_CNT; i++) {
    gen[i].init();
  }
}
int main() {
  input();
  hash_init();
  while (q--) {
    solve();
  }
  return 0;
}
