#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int mod1 = 1e9 + 7, mod2 = 1e9 + 9;
const int base1 = 233, base2 = 47;
pair<int, int> h[30][N];
int n, m, pw1[N], pw2[N];
char s[N];
inline pair<int, int> GetHashVal(int id, int l, int r) {
  pair<int, int> ans = h[id][r];
  ans.first =
      ((ans.first - 1ll * h[id][l - 1].first * pw1[r - l + 1]) % mod1 + mod1) %
      mod1;
  ans.second =
      ((ans.second - 1ll * h[id][l - 1].second * pw2[r - l + 1]) % mod2 +
       mod2) %
      mod2;
  return ans;
}
int main() {
  cin >> n >> m;
  scanf("%s", s + 1);
  pw1[0] = pw2[0] = 1;
  for (int i = 1; i <= n; i++) {
    pw1[i] = 1ll * pw1[i - 1] * base1 % mod1;
    pw2[i] = 1ll * pw2[i - 1] * base2 % mod2;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 26; j++) {
      h[j][i].first = (1ll * base1 * h[j][i - 1].first % mod1 +
                       1ll * (1 + ('a' + j == s[i])) * base1) %
                      mod1;
      h[j][i].second = (1ll * base2 * h[j][i - 1].second % mod2 +
                        1ll * (1 + ('a' + j == s[i])) * base2) %
                       mod2;
    }
  while (m--) {
    int x, y, len;
    scanf("%d%d%d", &x, &y, &len);
    multiset<pair<int, int> > A, B;
    for (int i = 0; i < 26; i++) {
      A.insert(GetHashVal(i, x, x + len - 1));
      B.insert(GetHashVal(i, y, y + len - 1));
    }
    printf("%s\n", A == B ? "YES" : "NO");
  }
  return 0;
}
