#include <bits/stdc++.h>
using namespace std;
template <class P, class Q>
inline void smin(P &a, Q b) {
  if (b < a) a = b;
}
template <class P, class Q>
inline void smax(P &a, Q b) {
  if (a < b) a = b;
}
const int base = 727;
const long long mod = 1LL << 48;
const int maxn = 200000 + 100;
int n, m;
string s;
int last[128];
vector<int> pos[128];
int prv[maxn];
long long hsh[maxn];
long long pw[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  cin >> s;
  for (int ch = (int)('a'), ch__b = (int)('z' + 1); ch < ch__b; ++ch)
    last[ch] = -1;
  pw[0] = 1;
  for (int i = 0, i__n = (int)(n); i < i__n; ++i) {
    pos[(int)s[i]].push_back(i);
    prv[i] = i - last[(int)s[i]];
    last[(int)s[i]] = i;
    hsh[i + 1] = hsh[i] * base + prv[i] % mod;
    pw[i + 1] = pw[i] * base % mod;
  }
  for (int z = 0, z__n = (int)(m); z < z__n; ++z) {
    int x, y, len;
    cin >> x >> y >> len;
    x--, y--;
    long long hash1 = hsh[x + len] - hsh[x] * pw[len] % mod;
    long long hash2 = hsh[y + len] - hsh[y] * pw[len] % mod;
    for (int ch = (int)('a'), ch__b = (int)('z' + 1); ch < ch__b; ++ch) {
      auto it = lower_bound((pos[ch]).begin(), (pos[ch]).end(), x);
      if (it < pos[ch].end() && *it < x + len)
        hash1 -= prv[*it] * pw[x + len - 1 - *it] % mod;
      it = lower_bound((pos[ch]).begin(), (pos[ch]).end(), y);
      if (it < pos[ch].end() && *it < y + len)
        hash2 -= prv[*it] * pw[y + len - 1 - *it] % mod;
    }
    hash1 = (hash1 % mod + mod) % mod;
    hash2 = (hash2 % mod + mod) % mod;
    cout << (hash1 == hash2 ? "YES" : "NO") << endl;
  }
  return 0;
}
