#include <bits/stdc++.h>
using namespace std;
const long long P1 = 1e9 + 7;
const long long P2 = 1e5 + 7;
const long long P3 = 1e7 + 7;
const int MAXN = 1e6 + 7;
const double EPS = 1e-8;
const long long Q = 31;
struct Hashs {
  vector<vector<long long> > hashs;
  vector<long long> pows;
  long long P;
  Hashs(string &s, long long P) : P(P) {
    long long n = s.size();
    pows.resize(n, 0);
    hashs.resize(n, vector<long long>(Q, 0));
    hashs[0][s[0] - 'a'] = 1;
    pows[0] = 1;
    for (long long i = 1; i < n; i++) {
      for (long long j = 0; j < Q; j++) {
        hashs[i][j] = hashs[i - 1][j] * 2 % P;
      }
      long long c = s[i] - 'a';
      hashs[i][c] = (hashs[i][c] + 1) % P;
      pows[i] = pows[i - 1] * 2 % P;
    }
  }
  vector<long long> get_hash(long long l, long long r) {
    if (!l) {
      return hashs[r];
    }
    vector<long long> res(Q, 0);
    for (long long i = 0; i < Q; i++) {
      res[i] = (hashs[r][i] - hashs[l - 1][i] * pows[r - l + 1] % P + P) % P;
    }
    return res;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<Hashs> data;
  data.push_back(Hashs(s, P1));
  data.push_back(Hashs(s, P2));
  data.push_back(Hashs(s, P3));
  for (long long i = 0; i < m; i++) {
    long long x, y, len;
    cin >> x >> y >> len;
    x--, y--;
    bool can = true;
    for (long long j = 0; j < 3; j++) {
      auto a = data[j].get_hash(x, x + len - 1);
      auto b = data[j].get_hash(y, y + len - 1);
      set<long long> all;
      for (long long x : b) {
        all.insert(x);
      }
      for (long long d = 0; d < Q; d++) {
        if (!a[d]) continue;
        if (all.find(a[d]) == all.end()) {
          can = false;
          break;
        }
      }
      if (!can) break;
    }
    cout << (can ? "YES" : "NO") << "\n";
  }
}
