#include <bits/stdc++.h>
using namespace std;
int n, m, p[200001], base = 419, mod = 1e9 + 7;
string s;
vector<int> ch[26], sum[26];
int powlog(int a, int b) {
  if (b == 0) return 1;
  int ret = powlog(a, b / 2);
  if (b % 2) return 1LL * ret * ret % mod * a % mod;
  return 1LL * ret * ret % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> s;
  p[0] = 1;
  for (int i = 1; i <= n; i++) p[i] = 1LL * base * p[i - 1] % mod;
  for (int i = 0; i < s.size(); i++) ch[s[i] - 'a'].push_back(i);
  for (int i = 0; i < 26; i++) {
    int cur = 0;
    for (auto &j : ch[i]) {
      cur = (cur + p[j]) % mod;
      sum[i].push_back(cur);
    }
  }
  while (m--) {
    int a, b, c, d, len;
    cin >> a >> c >> len;
    a--, c--;
    b = a + len - 1;
    d = c + len - 1;
    bool ans = 1;
    for (int i = 0; i < 26; i++) {
      int l1 = lower_bound(ch[i].begin(), ch[i].end(), a) - ch[i].begin();
      int r1 = upper_bound(ch[i].begin(), ch[i].end(), b) - ch[i].begin() - 1;
      if (r1 < l1) continue;
      int cor = s[c + ch[i][l1] - a] - 'a';
      int l2 = lower_bound(ch[cor].begin(), ch[cor].end(), c) - ch[cor].begin();
      int r2 =
          upper_bound(ch[cor].begin(), ch[cor].end(), d) - ch[cor].begin() - 1;
      if (r1 - l1 != r2 - l2) {
        ans = 0;
        break;
      }
      int val1 = (sum[i][r1] - (l1 == 0 ? 0 : sum[i][l1 - 1]) + mod) % mod;
      int val2 = (sum[cor][r2] - (l2 == 0 ? 0 : sum[cor][l2 - 1]) + mod) % mod;
      val1 = 1LL * val1 * powlog(p[ch[i][l1]], mod - 2) % mod;
      val2 = 1LL * val2 * powlog(p[ch[cor][l2]], mod - 2) % mod;
      if (val1 != val2) {
        ans = 0;
        break;
      }
    }
    if (ans)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
