#include <bits/stdc++.h>
using namespace std;
const long long inff = 0x3f3f3f3f3f3f3f3f;
string a;
const long long base = 163;
int n, m;
long long b[200008], ha[200008][26], c[26], d[26];
void as() {
  b[0] = 1;
  for (int i(1); i <= (200000); ++i) b[i] = (b[i - 1] * base) % int(1e9 + 7);
  for (int i(1); i <= (n); ++i)
    for (int j(0); j <= (25); ++j)
      ha[i][j] = (ha[i - 1][j] * base + ('a' + j == a[i - 1])) % int(1e9 + 7);
}
long long dog(int l, int r, int i) {
  return ((ha[r][i] - ha[l - 1][i] * b[r - l + 1]) % int(1e9 + 7) +
          int(1e9 + 7)) %
         int(1e9 + 7);
}
bool cheak(int x, int y, int z) {
  for (int i(0); i <= (25); ++i)
    c[i] = dog(x, x + z - 1, i), d[i] = dog(y, y + z - 1, i);
  sort(c, c + 26);
  sort(d, d + 26);
  for (int i(0); i <= (25); ++i)
    if (c[i] != d[i]) return 0;
  return 1;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  scanf("%d", &n), scanf("%d", &m);
  cin >> a;
  as();
  int x, y, z;
  while (m--) {
    scanf("%d", &x), scanf("%d", &y), scanf("%d", &z);
    if (cheak(x, y, z))
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
