#include <bits/stdc++.h>
namespace TNT {
const int MAXN = 2e5 + 10;
const int mod = 1e9 + 7;
const int base = 617;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
inline char cread() {
  char ch = getchar();
  while (ch < 'a' || ch > 'z') ch = getchar();
  return ch;
}
inline void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
long long h[30][MAXN], p[MAXN], a[30], b[30];
char s[MAXN];
long long get(int pos, int l, int r) {
  return ((h[pos][r] - h[pos][l - 1] * p[r - l + 1]) % mod + mod) % mod;
}
inline void main() {
  int n = read(), m = read(), x, y, len;
  p[0] = 1;
  for (register int i = 1; i <= n; i++)
    p[i] = (p[i - 1] * base) % mod, s[i] = cread();
  for (register int i = 0; i < 26; i++)
    for (register int j = 1; j <= n; j++)
      h[i][j] = ((h[i][j - 1] * base + (s[j] == 'a' + i)) % mod + mod) % mod;
  bool flag;
  for (register int i = 1, x, y, len; i <= m; i++) {
    x = read(), y = read(), len = read();
    for (register int j = 0; j < 26; j++)
      a[j] = (get(j, x, x + len - 1) % mod + mod) % mod,
      b[j] = (get(j, y, y + len - 1) % mod + mod) % mod;
    std::sort(a, a + 26), std::sort(b, b + 26);
    flag = 0;
    for (register int j = 0; j < 26; j++)
      if (a[j] != b[j]) {
        flag = 1;
        break;
      }
    puts(flag ? "NO" : "YES");
  }
  return;
}
}  // namespace TNT
int main() {
  TNT::main();
  return 0;
}
