#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long MOD = 1e9 + 7;
long long h[26][N], p[N];
int a[30], b[30];
char s[N + 10];
long long get(int i, int l, int r) {
  return (h[i][r] - h[i][l - 1] * p[r - l + 1]) % MOD;
}
int main() {
  int n, m, x, y, len;
  while (scanf("%d%d", &n, &m) != EOF) {
    p[0] = 1;
    for (int i = 1; i <= n; i++) p[i] = (p[i - 1] * 2) % MOD;
    scanf(" %s", s + 1);
    for (int i = 0; i < 26; i++)
      for (int j = 1; j <= n; j++)
        h[i][j] = (h[i][j - 1] * 2 + (s[j] == 'a' + i)) % MOD;
    while (m--) {
      scanf("%d%d%d", &x, &y, &len);
      for (int i = 0; i < 26; i++) {
        a[i] = (get(i, x, x + len - 1) + MOD) % MOD;
        b[i] = (get(i, y, y + len - 1) + MOD) % MOD;
      }
      sort(a, a + 26);
      sort(b, b + 26);
      bool flag = true;
      for (int i = 0; i < 26; i++)
        if (a[i] != b[i]) {
          flag = false;
          break;
        }
      printf("%s\n", flag ? "YES" : "NO");
    }
  }
}
