#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
  char c;
  int sign = 1;
  x = 0;
  do {
    c = getchar();
    if (c == '-') sign = -1;
  } while (!isdigit(c));
  do {
    x = x * 10 + c - '0';
    c = getchar();
  } while (isdigit(c));
  x *= sign;
}
const int N = 2e5 + 20, mod = 998244353;
int n, m, nxt[N][27], lst[27];
char s[N];
long long h[N][27], p[N];
inline void pre() {
  for (register int j = 'a'; j <= 'z'; ++j)
    for (register int i = 1; i <= n; ++i)
      h[i][j - 'a'] = (h[i - 1][j - 'a'] * 233 + (s[i] == j)) % mod;
  for (register int i = 'a'; i <= 'z'; ++i) lst[i - 'a'] = n + 1;
  for (register int i = n; i >= 1; --i) {
    lst[s[i] - 'a'] = i;
    for (register int j = 'a'; j <= 'z'; ++j) nxt[i][j - 'a'] = lst[j - 'a'];
  }
  p[0] = 1;
  for (register int i = 1; i <= n; ++i) p[i] = (p[i - 1] * 233) % mod;
}
inline bool judge(int w, int x, int y, int len) {
  int v = nxt[x][w];
  if (v >= x + len) return true;
  v = s[y + v - x] - 'a';
  return ((h[x + len - 1][w] - h[x - 1][w] * p[len]) % mod + mod) % mod ==
         ((h[y + len - 1][v] - h[y - 1][v] * p[len]) % mod + mod) % mod;
}
inline bool check(int x, int y, int len) {
  for (register int i = 'a'; i <= 'z'; ++i)
    if (!judge(i - 'a', x, y, len)) return false;
  return true;
}
int main() {
  read(n);
  read(m);
  scanf("%s", s + 1);
  pre();
  for (register int i = 1; i <= m; ++i) {
    int x, y, len;
    read(x);
    read(y);
    read(len);
    if (x > y) swap(x, y);
    puts(check(x, y, len) ? "YES" : "NO");
  }
  return 0;
}
