#include <bits/stdc++.h>
using namespace std;
long long n, m, f[30][500005], jz = 758, pw[5000005], mod = 1e9 + 7, x, y, z;
char a[1000001];
long long ask(long long l, long long r, long long ys) {
  long long ans = f[ys][r];
  l--;
  if (l >= 0) {
    ans = (ans - f[ys][l] * pw[r - l] % mod + mod) % mod;
  }
  return ans;
}
template <class T>
T read(T &num) {
  T x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') {
      f = -1;
    }
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  num = x * f;
  return num;
}
int main() {
  scanf("%lld%lld", &n, &m);
  scanf("%s", a + 1);
  pw[0] = 1;
  for (int i = 1; i < 500000; i++) {
    pw[i] = pw[i - 1] * jz % mod;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 25; j++) {
      f[j][i] = (f[j][i - 1] * jz + 1 + (j == a[i] - 'a')) % mod;
    }
  }
  for (int i = 1, x, y, z; i <= m; i++) {
    read(x);
    read(y);
    read(z);
    multiset<long long> s, t;
    for (long long j = 0; j <= 25; j++) {
      s.insert(ask(x, x + z - 1, j));
      t.insert(ask(y, y + z - 1, j));
    }
    if (s == t) cout << "YES" << endl;
    if (s != t) cout << "NO" << endl;
  }
}
