#include <bits/stdc++.h>
using namespace std;
const int maxn = 200050;
const long long MOD = 1e9 + 7;
long long h[26][maxn], x = 107, px[maxn];
char s[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  px[0] = 1;
  for (int i = 1; i <= n; ++i) px[i] = px[i - 1] * x % MOD;
  for (int i = 0; i < 26; ++i) {
    for (int j = 1; j <= n; ++j) {
      h[i][j] = (h[i][j - 1] * x + int(s[j] == i + 'a')) % MOD;
    }
  }
  while (m--) {
    int x, y, l;
    scanf("%d%d%d", &x, &y, &l);
    vector<int> p, q;
    for (int i = 0; i < 26; ++i) {
      p.push_back(((h[i][x + l - 1] - px[l] * h[i][x - 1] % MOD) % MOD + MOD) %
                  MOD);
      q.push_back(((h[i][y + l - 1] - px[l] * h[i][y - 1] % MOD) % MOD + MOD) %
                  MOD);
    }
    sort(q.begin(), q.end());
    sort(p.begin(), p.end());
    printf("%s\n", p == q ? "YES" : "NO");
  }
  return 0;
}
