// ... ... .. ....!
// ... ....... .... ...!

#include<bits/stdc++.h>
using namespace std;

#define rep(i, n) for(int i = 0, i##__n = (int)(n); i < i##__n; ++i)
#define fer(i, a, b) for(int i = (int)(a), i##__b = (int)(b); i < i##__b; ++i)
#define rof(i, b, a) for(int i = (int)(b), i##__a = (int)(a); i-- > i##__a; )
#define sz(x) (int((x).size()))
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define X first
#define Y second
//#define endl '\n'

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; }

typedef long long ll;
typedef pair<int, int> pii;

////////////////////////////////////////////////////////////////////////////////

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);

	int tt; cin >> tt;
	while(tt--) {
		int n, q;
		cin >> n >> q;
		string s;
		cin >> s;
		string reversed_s = s;
		reverse(all(reversed_s));
		
		auto sub_find = [](string &s, string &sub) -> pii {
			int pos = 0;
			int lft = sz(s), rgt = -1;
			for(char ch: sub) {
				while(s[pos] != ch) pos++;
				smin(lft, pos);
				smax(rgt, pos);
				pos++;
			}
			return pii(lft, rgt);
		};

		while(q--) {
			int l, r; cin >> l >> r; l--;
			string sub = s.substr(l, r - l);
			string reversed_sub = sub;
			reverse(all(reversed_sub));
			auto lfind = sub_find(s, sub);
			auto rfind = sub_find(reversed_s, reversed_sub);
			swap(rfind.X, rfind.Y);
			rfind.X = sz(s) - rfind.X - 1;
			rfind.Y = sz(s) - rfind.Y - 1;
			cout << (lfind != rfind ? "YES" : "NO") << endl;
		}
	}

	return 0;
}

