#include <bits/stdc++.h>
using namespace std;
const int MAXBUF = 1234567;
char B[MAXBUF], *Si = B, *Ti = B;
inline char getc() {
  if (Si == Ti) Ti = (Si = B) + fread(B, 1, MAXBUF, stdin);
  if (Si == Ti) return 0;
  return *Si++;
}
template <class T>
inline void read(T &a) {
  static char c;
  while (((c = getc()) < '0' || c > '9'))
    ;
  a = c - '0';
  while ((c = getc()) >= '0' && c <= '9') a = (a << 3) + (a << 1) + c - '0';
}
char Buff[MAXBUF], *sti = Buff;
char s[200005];
const int m1 = 1004535809;
int p1[200005];
int t1[200005];
int k1[200005];
int x1[200005];
int po[27], n, m;
bool vis[200005];
bool ans[200005];
struct node {
  int l, r, id;
} t[400005];
inline bool cmp(node a, node b) { return a.l > b.l; }
inline void add_1(int &a, int b) { a = (a + b >= m1 ? a + b - m1 : a + b); }
inline int qpow(int a, int b, int mod) {
  int res = 1, tp = a;
  while (b) {
    if (b & 1) res = 1ll * res * tp % mod;
    tp = 1ll * tp * tp % mod;
    b >>= 1;
  }
  return res;
}
inline void add1(int pos, int val) {
  while (pos <= n) add_1(t1[pos], val), pos += (pos & (-pos));
}
inline int ask1(int pos) {
  int s = 0;
  while (pos) add_1(s, t1[pos]), pos -= (pos & (-pos));
  return s;
}
int main() {
  int i, j, x, y, len, cnt = 0, pos = 1;
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  int i1 = qpow(97, m1 - 2, m1);
  for (p1[0] = 1, i = 1; i <= n; i++) p1[i] = 97ll * p1[i - 1] % m1;
  for (k1[0] = 1, i = 1; i <= n; i++) k1[i] = 1ll * k1[i - 1] * i1 % m1;
  memset(po, -1, sizeof(po));
  for (i = 1; i <= m; i++) {
    read(x);
    read(y);
    read(len);
    t[++cnt].l = x;
    t[cnt].r = x + len - 1;
    t[cnt].id = i;
    t[++cnt].l = y;
    t[cnt].r = y + len - 1;
    t[cnt].id = i;
  }
  sort(t + 1, t + cnt + 1, cmp);
  for (i = n; i >= 1; i--) {
    if (po[s[i] - 'a'] != -1) {
      int o = po[s[i] - 'a'], x = o - i;
      add1(o, 1ll * x * p1[o] % m1);
    }
    po[s[i] - 'a'] = i;
    while (pos <= cnt && t[pos].l == i) {
      int u1 = 1ll * ask1(t[pos].r) * k1[i] % m1;
      if (!vis[t[pos].id]) {
        x1[t[pos].id] = u1;
        vis[t[pos].id] = 1;
        pos++;
        continue;
      }
      if (x1[t[pos].id] == u1) ans[t[pos].id] = 1;
      pos++;
    }
  }
  for (i = 1; i <= m; i++) {
    if (ans[i]) {
      *sti++ = 'Y';
      *sti++ = 'E';
      *sti++ = 'S';
    } else {
      *sti++ = 'N';
      *sti++ = 'O';
    }
    *sti++ = '\n';
  }
  fwrite(Buff, 1, sti - Buff, stdout);
  return 0;
}
