#include <bits/stdc++.h>
using namespace std;
const long long P = 1e9 + 3, P2 = 1e9 + 7;
const long long mul = 131, mul2 = 13331;
int n, m;
char s[200005];
long long f[30][200005], o[200005];
long long p[30][200005], oo[200005];
long long a[30], b[30];
long long c[30], d[30];
long long Hash1(int x, int y, int i) {
  return (f[i][y] - f[i][x - 1] * o[y - x + 1] % P + P) % P;
}
long long Hash2(int x, int y, int i) {
  return (p[i][y] - p[i][x - 1] * oo[y - x + 1] % P2 + P2) % P2;
}
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  o[0] = 1, oo[0] = 1;
  for (int i = 1; i <= n; i++) {
    int ch = s[i] - 'a' + 1;
    for (int j = 1; j <= 26; j++) {
      f[j][i] = (f[j][i - 1] * mul + (j == ch)) % P;
      p[j][i] = (p[j][i - 1] * mul2 + (j == ch)) % P2;
    }
    o[i] = o[i - 1] * mul % P;
    oo[i] = oo[i - 1] * mul2 % P2;
  }
  for (int i = 1; i <= m; i++) {
    int x, y, len;
    scanf("%d%d%d", &x, &y, &len);
    for (int j = 1; j <= 26; j++)
      a[j] = Hash1(x, x + len - 1, j), c[j] = Hash1(y, y + len - 1, j);
    for (int j = 1; j <= 26; j++)
      b[j] = Hash2(x, x + len - 1, j), d[j] = Hash2(y, y + len - 1, j);
    sort(a + 1, a + 26 + 1), sort(b + 1, b + 26 + 1), sort(c + 1, c + 26 + 1),
        sort(d + 1, d + 26 + 1);
    int ok = 1;
    for (int j = 1; j <= 26; j++) {
      if (a[j] != c[j]) {
        ok = 0;
        break;
      }
    }
    for (int j = 1; j <= 26; j++) {
      if (b[j] != d[j]) {
        ok = 0;
        break;
      }
    }
    if (ok)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
