#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 1;
const int seed = 11;
const int mod = 1e9 + 7;
int n, m;
unsigned long long t[MAXN][26] = {0}, p[MAXN] = {1};
string s;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> m >> s;
  for (register int i = 1, j; i <= n; ++i) {
    for (j = 0; j < 26; ++j)
      t[i][j] = (t[i - 1][j] * seed + (s[i - 1] == 97 + j)) % mod;
    p[i] = p[i - 1] * seed % mod;
  }
  for (int i = 1, j, x, y, len, ans; i <= m; ++i) {
    cin >> x >> y >> len;
    static unsigned long long tx[26], ty[26];
    for (j = 0; j < 26; ++j) {
      tx[j] = (t[x + len - 1][j] - t[x - 1][j] * p[len] % mod + mod) % mod;
      ty[j] = (t[y + len - 1][j] - t[y - 1][j] * p[len] % mod + mod) % mod;
    }
    sort(tx, tx + 26), sort(ty, ty + 26);
    for (j = 0, ans = 1; j < 26; ++j)
      if (tx[j] != ty[j]) {
        ans = 0;
        break;
      }
    cout << (ans ? "YES" : "NO") << '\n';
  }
  return 0;
}
