#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
const long long bas = 987625403;
const long long mod = 1e9 + 7;
int board[30][N];
long long __hash[30][N];
long long pw[N];
long long query(int l, int r, int ch) {
  long long ans = __hash[ch][r - 1];
  if (l >= 1) ans = (ans - ((__hash[ch][l - 1] * pw[r - l]) % mod) + mod) % mod;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  for (int i = int(0); i < int(26); ++i) board[i][n] = N;
  for (int i = int(n - 1); i >= int(0); i--) {
    for (int j = int(0); j < int(26); ++j) board[j][i] = board[j][i + 1];
    board[s[i] - 'a'][i] = i;
  }
  pw[0] = 1;
  for (int i = int(1); i < int(n + 1); ++i) pw[i] = (pw[i - 1] * bas) % mod;
  for (int i = int(0); i < int(26); ++i) {
    long long phash = 0;
    for (int j = int(0); j < int(n); ++j) {
      phash = (phash * bas) % mod;
      if (s[j] - 'a' == i) phash++;
      phash %= mod;
      __hash[i][j] = phash;
    }
  }
  while (q--) {
    int p1, p2, tam;
    cin >> p1 >> p2 >> tam;
    p1--;
    p2--;
    vector<pair<int, int> > w1, w2;
    for (int i = int(0); i < int(26); ++i)
      if (board[i][p1] < p1 + tam) w1.push_back({board[i][p1], i});
    for (int i = int(0); i < int(26); ++i)
      if (board[i][p2] < p2 + tam) w2.push_back({board[i][p2], i});
    sort((w1).begin(), (w1).end());
    sort((w2).begin(), (w2).end());
    if (int((w1).size()) != int((w2).size()))
      cout << "NO" << endl;
    else {
      long long __hash1 = 0, __hash2 = 0;
      bool _issame = true;
      for (int i = int(0); i < int(int((w1).size())); ++i) {
        int c1 = w1[i].second, c2 = w2[i].second;
        __hash1 = query(p1, p1 + tam, c1);
        __hash2 = query(p2, p2 + tam, c2);
        if (__hash1 != __hash2) _issame = false;
      }
      if (_issame)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
