#include <bits/stdc++.h>
using namespace std;
int read() {
  int f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 - '0' + s;
    s = getchar();
  }
  return x * f;
}
long long qkpow(long long a, long long b, long long mod) {
  long long res = 1ll;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long mod1 = 998244353, mod2 = 1e8 + 7;
int n, m, i, j, k, s, o;
char ss[200005 << 1];
long long pow1[200005], pow2[200005];
int has[200005 << 1][2][29];
long long c[200005][29][2];
long long inv2[2] = {qkpow(2ll, mod1 - 2, mod1), qkpow(2ll, mod2 - 2, mod2)};
int L, R;
int sq = 0;
struct qu {
  int l, r, id;
} q[200005 << 1];
bool cmp(qu a, qu b) {
  if (a.l / sq != b.l / sq) return a.l < b.l;
  return a.r < b.r;
}
signed main() {
  n = read();
  m = read();
  pow1[0] = 1;
  pow2[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    pow1[i] = pow1[i - 1] * 2ll % mod1;
    pow2[i] = pow2[i - 1] * 2ll % mod2;
  }
  scanf("%s", ss + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) {
      c[i][j][0] = c[i - 1][j][0] * 2ll % mod1;
      c[i][j][1] = c[i - 1][j][1] * 2ll % mod2;
    }
    c[i][ss[i] - 'a'][0] += 1ll;
    c[i][ss[i] - 'a'][1] += 1ll;
    c[i][ss[i] - 'a'][0] %= mod1;
    c[i][ss[i] - 'a'][1] %= mod2;
  }
  for (int i = 1; i <= m; i++) {
    s = read();
    o = read();
    k = read();
    int l1 = s, l2 = o;
    int r1 = s + k - 1, r2 = o + k - 1;
    for (int j = 0; j < 26; j++) {
      has[i << 1][0][j] =
          (c[r1][j][0] + mod1 - (c[l1 - 1][j][0] * pow1[k] % mod1)) % mod1;
      has[i << 1][1][j] =
          (c[r1][j][1] + mod2 - (c[l1 - 1][j][1] * pow2[k] % mod2)) % mod2;
      has[i << 1 | 1][0][j] =
          (c[r2][j][0] + mod1 - (c[l2 - 1][j][0] * pow1[k] % mod1)) % mod1;
      has[i << 1 | 1][1][j] =
          (c[r2][j][1] + mod2 - (c[l2 - 1][j][1] * pow2[k] % mod2)) % mod2;
    }
    sort(has[i << 1][0], has[i << 1][0] + 26);
    sort(has[i << 1][1], has[i << 1][1] + 26);
    sort(has[i << 1 | 1][0], has[i << 1 | 1][0] + 26);
    sort(has[i << 1 | 1][1], has[i << 1 | 1][1] + 26);
  }
  for (int i = 1; i <= m; i++) {
    bool flag = 1;
    for (int j = 0; j < 26; j++) {
      if (has[i << 1][0][j] != has[i << 1 | 1][0][j] ||
          has[i << 1][1][j] != has[i << 1 | 1][1][j]) {
        flag = 0;
        break;
      }
    }
    printf(flag ? "YES\n" : "NO\n");
  }
  return 0;
}
