#include <bits/stdc++.h>
using namespace std;
const long long mod = (int)1e9 + 7;
const long long base = 131;
const int N = 2e5 + 100;
char str[N];
int val[N][30];
long long Hash[N];
int n, m;
void init() {
  Hash[0] = 1;
  for (int i = 1; i < N; i++) Hash[i] = (Hash[i - 1] * base) % mod;
}
void getHash() {
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 26; j++) val[i][j] = (val[i - 1][j] * base) % mod;
    int id = str[i] - 'a' + 1;
    val[i][id] = (val[i][id] + 1) % mod;
    val[i][0] = (val[i][0] + str[i] - 'a' + 1) % mod;
  }
}
long long Get(int id, int l, int r) {
  return ((val[r][id] - val[l - 1][id] * Hash[r - l + 1]) % mod + mod) % mod;
}
int vis[27];
vector<int> son[27];
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", str + 1);
  init();
  getHash();
  for (int i = 1; i <= n; i++) son[str[i] - 'a'].push_back(i);
  for (int i = 0; i < 26; i++) son[i].push_back(n + 1);
  int s, t, l;
  long long t1, t2;
  while (m--) {
    memset(vis, 0, sizeof(vis));
    scanf("%d%d%d", &s, &t, &l);
    t1 = Get(0, t, t + l - 1);
    t2 = 0;
    int f = 1;
    for (int i = 0; i < 26; i++) {
      int pos = *lower_bound(son[i].begin(), son[i].end(), s);
      if (pos > s + l - 1) continue;
      int tt = str[t + (pos - s)] - 'a';
      if (vis[tt]) {
        f = 0;
        break;
      } else
        vis[tt] = 1;
      t2 += Get(i + 1, s, s + l - 1) * (tt + 1);
    }
    t2 %= mod;
    if (f && t1 == t2)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
