#include <bits/stdc++.h>
using namespace std;
long long int sum[(int)(2e5 + 5)][30], p[(int)(2e5 + 5)], hs[(int)(2e5 + 5)];
int mp[30], chk[30];
char s[(int)(2e5 + 5)];
vector<int> v[30];
long long int powr(long long int n, long long int p) {
  if (p == 0) return 1;
  if (p % 2 == 0) return powr((n * n) % (int)(1e9 + 7), p / 2);
  return (powr((n * n) % (int)(1e9 + 7), p / 2) * n) % (int)(1e9 + 7);
}
long long int gethash(int i, int j) {
  int l = j - i + 1;
  long long int ans = 0;
  ans = (ans + hs[j]) % (int)(1e9 + 7);
  if (i > 0) ans = (ans - (hs[i - 1] * p[l]) % (int)(1e9 + 7)) % (int)(1e9 + 7);
  return ans;
}
long long int conv(int i, int j) {
  int l = j - i + 1;
  long long int ans = 0, tmp;
  for (int k = 0; k < 26; k++) {
    if (mp[k] == -1) continue;
    tmp = sum[j][k];
    if (i > 0)
      tmp = (tmp - (sum[i - 1][k] * p[l]) % (int)(1e9 + 7)) % (int)(1e9 + 7);
    tmp = (tmp * (mp[k] + 1)) % (int)(1e9 + 7);
    ans = (ans + tmp) % (int)(1e9 + 7);
  }
  return ans;
}
int bs(int i, int n, int n1) {
  if (v[i].size() == 0) return -1;
  int l = 0, r = v[i].size() - 1, m;
  while (l < r) {
    m = (l + r) / 2;
    if (v[i][m] == n) return n;
    if (v[i][m] < n)
      l = m + 1;
    else
      r = m;
  }
  if (v[i][l] > n) return v[i][l];
  if (v[i][l] < n) {
    if (l != v[i].size() - 1)
      return v[i][l + 1];
    else
      return n1 + 1;
  }
}
int main() {
  int n, m, i, j, k, l, h;
  long long int b = 30, num1, num2;
  scanf("%d %d", &n, &m);
  scanf("%s", s);
  for (i = 0; i < n; i++) {
    v[s[i] - 'a'].push_back(i);
    if (i == 0) {
      p[i] = 1;
      hs[i] = (s[i] - 'a' + 1);
    } else {
      p[i] = (p[i - 1] * b) % (int)(1e9 + 7);
      hs[i] = (hs[i - 1] * b + (s[i] - 'a' + 1)) % (int)(1e9 + 7);
    }
    for (j = 0; j < 26; j++) {
      if (i == 0)
        sum[i][j] = (s[i] - 'a' == j);
      else
        sum[i][j] = (sum[i - 1][j] * b + (s[i] - 'a' == j)) % (int)(1e9 + 7);
    }
  }
  while (m--) {
    scanf("%d %d %d", &i, &j, &l);
    i--;
    j--;
    memset(chk, -1, sizeof(chk));
    for (k = 0; k < 26; k++) {
      h = bs(k, i, n);
      if (h == -1 || h - i + 1 > l) {
        mp[k] = -1;
        continue;
      }
      if (chk[s[h - i + j] - 'a'] == 1) {
        printf("NO\n");
        break;
      }
      mp[k] = s[h - i + j] - 'a';
      chk[s[h - i + j] - 'a'] = 1;
    }
    if (k < 26) continue;
    num1 = gethash(j, j + l - 1);
    if (num1 < 0) num1 += (int)(1e9 + 7);
    num2 = conv(i, i + l - 1);
    if (num2 < 0) num2 += (int)(1e9 + 7);
    if (num1 == num2)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
