#include <bits/stdc++.h>
using namespace std;
const int64_t base = 2, mod = 1e9 + 9;
int64_t n, T, M[200005], H[30][200005];
char s[200005];
vector<int64_t> V1, V2;
int64_t GetHash(int64_t i, int64_t l, int64_t r) {
  return (H[i][r] - H[i][l - 1] * M[r - l + 1] + mod * mod) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> T >> s + 1;
  M[0] = 1;
  for (int64_t i = 1; i <= n; i++) M[i] = M[i - 1] * base % mod;
  for (int64_t i = 0; i <= 25; i++)
    for (int64_t j = 1; j <= n; j++)
      H[i][j] = (H[i][j - 1] * base + (s[j] - 'a' == i)) % mod;
  int64_t l1, l2, len;
  while (T--) {
    cin >> l1 >> l2 >> len;
    V1.clear();
    V2.clear();
    for (int64_t i = 0; i <= 25; i++) {
      V1.push_back(GetHash(i, l1, l1 + len - 1));
      V2.push_back(GetHash(i, l2, l2 + len - 1));
    }
    sort(V1.begin(), V1.end());
    sort(V2.begin(), V2.end());
    if (V1 == V2)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
