#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 2e5 + 5;
vector<int> p = {10006793, 1777771,  10101283, 10101823,
                 10136359, 10157387, 10166249};
vector<int> mod = {999992867,  1070777777, 999727999,  1000008223, 1000009999,
                   1000003211, 1000027163, 1000002193, 1000000123};
struct Hash {
  int x, y;
  Hash(long long x = 0) : x(x % mod[0]), y(x % mod[1]) {}
  Hash(long long x, long long y) : x(x % mod[0]), y(y % mod[1]) {}
  Hash operator+(Hash h) { return Hash(x + h.x, y + h.y); }
  Hash operator-(Hash h) { return Hash(x - h.x + mod[0], y - h.y + mod[1]); }
  Hash operator*(Hash h) { return Hash(1LL * x * h.x, 1LL * y * h.y); }
  bool operator<(const Hash h) const { return tie(x, y) < tie(h.x, h.y); }
  bool operator==(const Hash h) const { return tie(x, y) == tie(h.x, h.y); }
};
Hash h[26][N], pw[N];
string second, t;
int n, m;
int main() {
  cin.tie(0)->sync_with_stdio(0), cout.tie(0);
  shuffle(begin(p), end(p), rng), shuffle(begin(mod), end(mod), rng);
  cin >> n >> m >> second;
  pw[0] = Hash(1);
  for (auto i = (1) - ((1) > (n + 1)); i != n + 1 - ((1) > (n + 1));
       i += 1 - 2 * ((1) > (n + 1)))
    pw[i] = pw[i - 1] * Hash(p[0]);
  for (auto c = (0) - ((0) > (26)); c != 26 - ((0) > (26));
       c += 1 - 2 * ((0) > (26))) {
    h[c][0] = Hash(0);
    for (auto i = (0) - ((0) > (n)); i != n - ((0) > (n));
         i += 1 - 2 * ((0) > (n))) {
      int k = int(second[i] - 'a' == c);
      h[c][i + 1] = h[c][i] + Hash(k) * pw[i];
    }
  }
  int x, y, len;
  while (m--) {
    cin >> x >> y >> len;
    x--, y--;
    multiset<Hash> st;
    for (auto c = (0) - ((0) > (26)); c != 26 - ((0) > (26));
         c += 1 - 2 * ((0) > (26))) {
      Hash cutx = (h[c][x + len] - h[c][x]) * pw[n - x];
      st.insert(cutx);
    }
    for (auto c = (0) - ((0) > (26)); c != 26 - ((0) > (26));
         c += 1 - 2 * ((0) > (26))) {
      Hash cuty = (h[c][y + len] - h[c][y]) * pw[n - y];
      auto it = st.find(cuty);
      if (it != st.end()) st.erase(st.find(cuty));
    }
    cout << (st.empty() ? "YES" : "NO") << '\n';
  }
  return 0;
}
