#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6, seed = 49999, mod = 1e9 + 7;
const long long delta = 1e10;
long long h[30][maxn], pw[maxn];
long long hsh(long long x, long long y, long long z) {
  return (h[z][x] - (y == 0 ? 0 : (h[z][y - 1] * pw[x - y + 1]) % mod) + mod) %
         mod;
}
int32_t main() {
  ios_base::sync_with_stdio(0), cout.tie(0), cin.tie(0);
  long long n, q;
  string s;
  cin >> n >> q >> s;
  pw[0] = 1;
  for (long long(i) = (0); (i) < (26); ++(i))
    for (long long(j) = (0); (j) < (n); ++(j))
      h[i][j] = (h[i][j - 1] * seed + (s[j] == 'a' + i)) % mod;
  for (long long(i) = (1); (i) < (n + 1); ++(i))
    pw[i] = (pw[i - 1] * seed) % mod;
  while (q--) {
    long long a[30] = {}, b[30] = {};
    long long x, y, l;
    cin >> x >> y >> l;
    --x;
    --y;
    for (long long(i) = (0); (i) < (26); ++(i)) {
      a[i] = hsh(x + l - 1, x, i);
      b[i] = hsh(y + l - 1, y, i);
    }
    sort(a, a + 30);
    sort(b, b + 30);
    bool ans = 1;
    for (long long(i) = (0); (i) < (30); ++(i))
      if (a[i] != b[i]) ans = 0;
    if (ans)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
