#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int MOD;
int n, m;
char s[MAXN];
int f[26][MAXN];
int pw[MAXN];
struct hash_t {
  int h[MAXN];
  void build(int x) {
    for (int i = 1; i <= n; ++i) {
      h[i] = (h[i - 1] * 26LL + (s[i] - 'a' == x)) % MOD;
    }
  }
  int get_hash(int l, int r) {
    --l;
    return (h[r] - 1LL * h[l] * pw[r - l] + 1LL * MOD * MOD) % MOD;
  }
} hs[26];
void init() {
  srand(time(NULL));
  MOD = 1000000000 + (rand() * rand() + rand()) % 1000000000;
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) {
    pw[i] = pw[i - 1] * 26LL % MOD;
  }
  for (int c = 0; c < 26; ++c) {
    hs[c].build(c);
    f[c][n + 1] = n + 1;
    for (int i = n; i >= 1; --i) {
      f[c][i] = s[i] - 'a' == c ? i : f[c][i + 1];
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  init();
  while (m--) {
    int x, y, len;
    scanf("%d%d%d", &x, &y, &len);
    bool mark[26] = {}, ok = true;
    int sh = 0, th = 0;
    for (int c = 0; c < 26; ++c) {
      if (f[c][x] <= x + len - 1) {
        int g = s[y + f[c][x] - x] - 'a';
        if (mark[g]) {
          ok = false;
          break;
        }
        mark[g] = true;
        sh = (sh + 1LL * g * hs[c].get_hash(x, x + len - 1)) % MOD;
      }
      th = (th + 1LL * c * hs[c].get_hash(y, y + len - 1)) % MOD;
    }
    puts(ok && sh == th ? "YES" : "NO");
  }
  return 0;
}
