#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long a, long long b) {
  return a == 0 ? b : gcd(b % a, a);
}
inline long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
inline long long rd() {
  long long 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;
}
const int maxn = 2e5 + 10;
const int mod = 1e9 + 7;
unsigned long long p1[maxn] = {1}, p2[maxn] = {1};
char s[maxn];
unsigned long long hashtable1[27][maxn], hashtable2[27][maxn];
inline unsigned long long gethash1(int i, int l, int r) {
  return (hashtable1[i][r] - (hashtable1[i][l - 1] * p1[r - l + 1]) % mod +
          mod) %
         mod;
}
inline unsigned long long gethash2(int i, int l, int r) {
  return (hashtable2[i][r] - (hashtable2[i][l - 1] * p2[r - l + 1]) % mod +
          mod) %
         mod;
}
unsigned long long a1[27], b1[27], a2[27], b2[27];
inline bool check() {
  sort(a1, a1 + 26);
  sort(a2, a2 + 26);
  sort(b1, b1 + 26);
  sort(b2, b2 + 26);
  for (int i = 0; i < 26; i++) {
    if (a1[i] != b1[i] || a2[i] != b2[i]) return false;
  }
  return true;
}
int main() {
  int n = rd(), q = rd();
  for (int i = 1; i <= n; i++)
    p1[i] = (p1[i - 1] * 131) % mod, p2[i] = (p2[i - 1] * 13331) % mod;
  scanf("%s", s + 1);
  for (int i = 0; i < 26; i++) {
    for (int j = 1; s[j]; j++) {
      hashtable1[i][j] =
          (hashtable1[i][j - 1] * 131 + (s[j] == 'a' + i) * 3) % mod;
      hashtable2[i][j] =
          (hashtable2[i][j - 1] * 13331 + (s[j] == 'a' + i) * 3) % mod;
    }
  }
  while (q--) {
    int x = rd(), y = rd(), len = rd();
    for (int i = 0; i < 26; i++) {
      a1[i] = gethash1(i, x, len + x - 1);
      b1[i] = gethash1(i, y, len + y - 1);
      a2[i] = gethash2(i, x, len + x - 1);
      b2[i] = gethash2(i, y, len + y - 1);
    }
    printf("%s\n", check() ? "YES" : "NO");
  }
}
