#include <bits/stdc++.h>
using namespace std;
int n, q;
string s;
long long o0o0o0[30][200005];
long long po[200005];
inline void Add(long long &x, long long y) {
  x += y;
  if (x < 0) x += 998244353;
  if (x >= 998244353) x -= 998244353;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> q;
  cin >> s;
  po[0] = 1;
  for (int i = 1; i < 200005; i++) Add(po[i], po[i - 1] << 1);
  for (int i = 1; i <= 26; i++) o0o0o0[i][0] = (s[0] - 'a' + 1 == i);
  for (int i = 1; i < s.size(); i++)
    for (int j = 1; j <= 26; j++)
      Add(o0o0o0[j][i], o0o0o0[j][i - 1] * 2 + (s[i] - 'a' + 1 == j));
  while (q--) {
    int x, y, len;
    cin >> x >> y >> len;
    x--;
    y--;
    if (x > y) swap(x, y);
    vector<long long> vx, vy;
    for (int i = 1; i <= 26; i++) {
      long long x_ =
          o0o0o0[i][x + len - 1] - o0o0o0[i][x - 1] * po[len] % 998244353;
      Add(x_, 0);
      vx.push_back(x_);
      long long y_ =
          o0o0o0[i][y + len - 1] - o0o0o0[i][y - 1] * po[len] % 998244353;
      Add(y_, 0);
      vy.push_back(y_);
    }
    sort(vx.begin(), vx.end());
    sort(vy.begin(), vy.end());
    if (vx == vy)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
