#include <bits/stdc++.h>
using namespace std;
string s;
const long long int K1 = 1e9 + 7, K2 = 1e9 + 9, a1 = 19, a2 = 91;
long long int mu(long long int a, long long int n, long long int mod) {
  if (n == 0) return 1;
  long long int q = mu(a, n / 2, mod);
  if (n % 2 == 0) return q * q % mod;
  return q * q % mod * a % mod;
}
long long int s1[30][200005], s2[30][200005], s3[30][200004];
long long int mu1[200005], mu2[200005], rev1[200005], rev2[200005];
vector<pair<long long int, long long int> > v1, v2;
pair<long long int, long long int> calc(int a, int x, int len) {
  len += x;
  long long int A = (s1[a][len - 1] - s1[a][x - 1]) * rev1[x] % K1;
  A = (A + K1) % K1;
  long long int C = s3[a][len - 1] - s3[a][x - 1];
  return pair<long long int, long long int>(A, C);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int n, q;
  cin >> n >> q;
  cin >> s;
  mu1[0] = mu2[0] = 1;
  rev1[0] = rev2[0] = 1;
  for (int i = 1; i <= n + 2; i++) {
    mu1[i] = mu1[i - 1] * a1 % K1;
    mu2[i] = mu2[i - 1] * a2 % K2;
    rev1[i] = mu(mu1[i], K1 - 2, K1);
    rev2[i] = mu(mu2[i], K2 - 2, K2);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 'a'; j <= 'z'; j++) {
      s1[j - 'a'][i] = s1[j - 'a'][i - 1];
      s2[j - 'a'][i] = s2[j - 'a'][i - 1];
      s3[j - 'a'][i] = s3[j - 'a'][i - 1];
    }
    s1[s[i - 1] - 'a'][i] = (s1[s[i - 1] - 'a'][i] + mu1[i]) % K1;
    s2[s[i - 1] - 'a'][i] = (s2[s[i - 1] - 'a'][i] + mu2[i]) % K2;
    s3[s[i - 1] - 'a'][i] = (s3[s[i - 1] - 'a'][i] + 1);
  }
  for (int z = 1; z <= q; z++) {
    int x, y, len;
    cin >> x >> y >> len;
    v1.clear();
    v2.clear();
    for (int i = 0; i <= 25; i++) {
      v1.push_back(calc(i, x, len));
      v2.push_back(calc(i, y, len));
    }
    sort(v1.begin(), v1.end());
    sort(v2.begin(), v2.end());
    bool qq = 1;
    for (int i = 0; i <= 25; i++) {
      if (v1[i] != v2[i]) {
        printf("NO\n");
        qq = 0;
        break;
      }
    }
    if (qq) printf("YES\n");
  }
  return 0;
}
