#include <bits/stdc++.h>
using namespace std;
const int P1 = 1000000007;
const int P2 = 1000000009;
const int BASE = 1000001;
const int N = 200005;
pair<int, int> operator+(pair<int, int> first, pair<int, int> second) {
  return {(first.first + second.first) % P1,
          (first.second + second.second) % P2};
}
pair<int, int> operator-(pair<int, int> first, pair<int, int> second) {
  return {(first.first - second.first + P1) % P1,
          (first.second - second.second + P2) % P2};
}
pair<int, int> operator*(pair<int, int> first, int second) {
  return {(1LL * first.first * second) % P1,
          (1LL * first.second * second) % P2};
}
pair<int, int> operator*(pair<int, int> first, pair<int, int> second) {
  return {(first.first * 1LL * second.first) % P1,
          (first.second * 1LL * second.second) % P2};
}
pair<int, int> pwBase[N];
vector<pair<int, int> > hs[26];
void init(string s) {
  int n = s.size();
  pwBase[0] = {1, 1};
  for (int i = 1; i < N; i++) {
    pwBase[i] = pwBase[i - 1] * BASE;
  }
  for (int i = 0; i < 26; i++) {
    hs[i].resize(n + 1, make_pair(0, 0));
    for (int j = n - 1; j >= 0; j--) {
      hs[i][j] =
          hs[i][j + 1] * BASE + make_pair(s[j] - 'a' == i, s[j] - 'a' == i);
    }
  }
}
pair<int, int> getHash(int l, int r, int c) {
  return hs[c][l] - hs[c][r + 1] * pwBase[r - l + 1];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  string s;
  cin >> n >> m >> s;
  init(s);
  while (m--) {
    int first, second, len;
    cin >> first >> second >> len;
    first--;
    second--;
    vector<pair<int, int> > vx, vy;
    for (int i = 0; i < 26; i++) {
      vx.push_back(getHash(first, first + len - 1, i));
      vy.push_back(getHash(second, second + len - 1, i));
    }
    sort(vx.begin(), vx.end());
    sort(vy.begin(), vy.end());
    bool ok = 1;
    for (int i = 0; i < 26; i++) {
      if (vx[i] != vy[i]) ok = 0;
    }
    cout << (ok ? "YES" : "NO") << '\n';
  }
  return 0;
}
