#include <bits/stdc++.h>
const long long u = 3, v = 131, mod = 1004535809;
const int N = 2e5 + 5;
int sum[26][N];
long long has[2][26][N], p[2][N], inv[2][N];
int n, m, a[26], b[26];
char s[N];
std::vector<std::pair<int, std::pair<long long, long long> > > l, r;
long long qpow(long long x, long long y) {
  long long res = 1;
  x %= mod;
  for (; y; y >>= 1, x = x * x % mod)
    if (y & 1) res = res * x % mod;
  return res;
}
int main() {
  p[0][0] = inv[0][0] = p[1][0] = inv[1][0] = 1;
  for (int i = 1; i < N; i++)
    p[0][i] = p[0][i - 1] * u % mod, inv[0][i] = qpow(p[0][i], mod - 2);
  for (int i = 1; i < N; i++)
    p[1][i] = p[1][i - 1] * v % mod, inv[1][i] = qpow(p[1][i], mod - 2);
  scanf("%d%d%s", &n, &m, s + 1);
  for (int i = 0; i < 26; i++) {
    for (int j = 1; j <= n; j++) {
      sum[i][j] = sum[i][j - 1];
      has[0][i][j] = has[0][i][j - 1];
      has[1][i][j] = has[1][i][j - 1];
      if (s[j] - 'a' == i)
        sum[i][j]++, has[0][i][j] = (has[0][i][j] + p[0][j]) % mod,
                     has[1][i][j] = (has[1][i][j] + p[1][j]) % mod;
    }
  }
  int x, y, len;
  while (m--) {
    scanf("%d%d%d", &x, &y, &len);
    l.clear(), r.clear();
    x--;
    y--;
    for (int i = 0; i < 26; i++) {
      if (sum[i][x + len] - sum[i][x] > 0)
        l.push_back(std::make_pair(
            sum[i][x + len] - sum[i][x],
            std::make_pair(
                (has[0][i][x + len] - has[0][i][x] + mod) * inv[0][x] % mod,
                (has[1][i][x + len] - has[1][i][x] + mod) * inv[1][x] % mod)));
      if (sum[i][y + len] - sum[i][y] > 0)
        r.push_back(std::make_pair(
            sum[i][y + len] - sum[i][y],
            std::make_pair(
                (has[0][i][y + len] - has[0][i][y] + mod) * inv[0][y] % mod,
                (has[1][i][y + len] - has[1][i][y] + mod) * inv[1][y] % mod)));
    }
    bool ok = false;
    if (l.size() == r.size()) {
      std::sort(l.begin(), l.end());
      std::sort(r.begin(), r.end());
      bool f = true;
      for (int i = 0; i < l.size(); i++) {
        if (l[i] != r[i]) f = false;
      }
      if (f) ok = true;
    }
    printf("%s\n", ok ? "YES" : "NO");
  }
  return 0;
}
